question

jackvsjackie avatar image
jackvsjackie asked

Set execution time between two queries

Hi basically my query consist multiple update and delete statements, even i placed it in correct order it wont execute the order i written it for eg. alter table table1 add column column1 as int update table1 set column1=1 this is what i want, but every time i run it, the result is (invalid column name 'column1') even i used waitfor delay command inbetween the above two query lines still its not working
time
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Kev Riley avatar image
Kev Riley answered
That error is generated by the parser - it doesn't know about column1. (The query you gave is has syntax errors too, but I presume that's just a result of typing it here) Add a batch separator 'GO', such as alter table table1 add column1 int go update table1 set column1=1
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

tanglesoft avatar image
tanglesoft answered
Not sure why you don't get an error but the correct syntax is ALTER TABLE table1 ADD column1 int UPDATE table1 SET column1 = 1
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.