How to pass in a Variable in an Update query

Sorry if I read this wrong, but shouldn’t your UPDATE SQL be:

UPDATE 
dbo.CampaignBatch
SET
ProcessStatusTypeId=200,
YourDateColumn=@YourDateVariable
where 
CampaignBatchId in ('value')

?

Where is the column to which you are updating the date to?

2 Likes