How to pass in a Variable in an Update query

Hi @achawla

From what @AndyMenon said think you can use like this,

"UPDATE dbo.CampaignBatch 
SET ProcessStatusTypeId=200,
YourDateColumn= "+Datetimevariable+"
where CampaignBatchId in ('357')"

You can convert the datetimevariable to string

And also remove the line breaks ,it should be in a single line.

Ex instead of using,

“Select
*
From table”

use

“Select * from table”

Thanks

1 Like