• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 280
  • Last Modified:

SQLCommand - Weird SQL Issue - Please help!

OK - I have the below (thanks to angelIII) which works great:

UPDATE MobileInvoiceImport SET QuantityReceived = '12' WHERE OrderDetailID =  '345'
GO
INSERT INTO MobileInvoiceImport  (OrderDetailID, QuantityReceived)  SELECT  '345', '88' WHERE NOT EXISTS (SELECT 1 FROM MobileInvoiceImport  WHERE OrderDetailID =  '345')


However, when I try to execute on a single line, such as:

UPDATE MobileInvoiceImport SET QuantityReceived = '12' WHERE OrderDetailID =  '345' GO INSERT INTO MobileInvoiceImport  (OrderDetailID, QuantityReceived)  SELECT  '345', '88' WHERE NOT EXISTS (SELECT 1 FROM MobileInvoiceImport  WHERE OrderDetailID =  '345')

I get an error - is there a way to get it to work as I am executing it via a SQLCeCommand
0
tbaseflug
Asked:
tbaseflug
1 Solution
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
GO is a special command for the osql/isql resp query analyzer tool.
when running the query with SQLCeCommand, you have to run them separately
0
 
bruintjeCommented:
Hi tbaseflug,

this is the same as your SQL question
http:Q_21838811.html#0 "SQLCommand - Weird SQL Issue - Please help!":

you should use a pointer question or have them both for 250 points each

hope this helps a bit
bruintje
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now