title: TRUNCATE TABLE on linked server failing
body: <p><strong>Context:</strong> I need to modify a stored procedure on my local instance of SQL Server 2019 to remotely connect to a linked server to truncate and re-populate a table. </p>
  
  <p>I create &amp; verify the linked server with below, runs successfully:</p>
  
  <pre><code>EXEC sp_addlinkedserver @server='PROD01' 
  EXEC sp_linkedservers
  </code></pre>
  
  <p>I run a test insert with the following that executes successfully:</p>
  
  <pre><code>INSERT OPENQUERY([PROD01],'SELECT Purchase_Order,PO_Line_Number, 
         Buyer_ID, 
         Requisition_ID, 
         Item_ID, 
         Item_Revision_ID, 
         PO_Line_Description, 
         Order_Quantity, 
         RECV_Qty, 
         Due_Date, 
         Original_Due_Date, 
         Todays_Status, 
         Delivery_Status, 
         Vendor_Name, 
         Requisitioner, 
         Level_1_Project_Name, 
         Inventory_Abbreviation_Code, 
         [Acknowledgment_Required_Flag YN], 
         Acknowledgment_Date, 
         REL_TO_VEND_DT, 
         Order_Date, 
         Purchase_Order_Line_Type, 
         Last_Update
  FROM [ORT].[dbo].[po_masterlist_report]') 
  --Local server instance below
  SELECT Purchase_Order, 
         PO_Line_Number, 
         Buyer_ID, 
         Requisition_ID, 
         Item_ID, 
         Item_Revision_ID, 
         PO_Line_Description, 
         Order_Quantity, 
         RECV_Qty, 
         Due_Date, 
         Original_Due_Date, 
         Todays_Status, 
         Delivery_Status, 
         Vendor_Name, 
         Requisitioner, 
         Level_1_Project_Name, 
         Inventory_Abbreviation_Code, 
         [Acknowledgment_Required_Flag YN], 
         Acknowledgment_Date, 
         REL_TO_VEND_DT, 
         Order_Date, 
         Purchase_Order_Line_Type, 
         [Last_Update]
  FROM [20Z2\SQLEXPRESS].[co_sb].[dbo].[po_masterlist_report]
  </code></pre>
  
  <p><strong>Question:</strong> When I try to run a truncate statement I raise following errors: </p>
  
  <pre><code>SELECT * FROM OPENQUERY ([PROD01], 'TRUNCATE TABLE [ORT].[dbo].[po_masterlist_report] SELECT "OK"' )
  </code></pre>
  
  <blockquote>
    <p>OLE DB provider "SQLNCLI10" for linked server "MSS-ISD-PROD01"
    returned message "Deferred prepare could not be completed.". </p>
    
    <p>Msg 8180,Level 16, State 1, Line 1 Statement(s) could not be prepared. </p>
    
    <p>Msg 102,Level 15, State 1, Line 1 Incorrect syntax near 'OK'.</p>
  </blockquote>
  
  <p>As suggested by a commenter I replaced the double quotes with single quotes and the query does execute without errors but the underlying table hasnt been truncated....so the query clearly isnt executing properly. Can someone please help me correct this syntax so it truncates the linked server table as intended?</p>
  
  <pre><code>SELECT * FROM OPENQUERY ([PROD01], 'TRUNCATE TABLE [ORT].[dbo].[po_masterlist_report] SELECT ''OK''' )
  </code></pre>