I have a stored procedure to update a table with invoice information. There are a bunch of calculation being done and the example below is to calcuate the prepaid shipping for a customer. If they use it I need to do one calcuation and if they don't I need to do another calcualtion to figure out their total charges. @customerID is a parameter passed to the sproc but this example below gives me a syntax error. Does anyone have any ideas what is wrong with it ? Thanks
IF(@customerID exists in(SELECT customerID FROM tblPrePaidShipping)) BEGIN . . . END
or better IF EXISTS (SELECT * FROM tblPrePaidShipping WHERE CustomerID = @CustomerID)
========================================== Cursors are useful if you don't know sql. DTS can be used in a similar way. Beer is not cold and it isn't fizzy.
========================================== Cursors are useful if you don't know sql. DTS can be used in a similar way. Beer is not cold and it isn't fizzy.
unfortunately yes (in this version anyway). I really hate seeing if exists (select 1 from ... ) but I have a lot of unreasonable opinions.
========================================== Cursors are useful if you don't know sql. DTS can be used in a similar way. Beer is not cold and it isn't fizzy.