Avatar of tbaseflug
tbaseflugFlag for United States of America

asked on 

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
C#

Avatar of undefined
Last Comment
Brian Mulder
ASKER CERTIFIED SOLUTION
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of Brian Mulder
Brian Mulder
Flag of Netherlands image

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
C#
C#

C# is an object-oriented programming language created in conjunction with Microsoft’s .NET framework. Compilation is usually done into the Microsoft Intermediate Language (MSIL), which is then JIT-compiled to native code (and cached) during execution in the Common Language Runtime (CLR).

98K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo