|
Hi All, I just want to update a record in a table which exist in all the databases of a particular SQL Server 2008 instance. But while trying the below script i'm getting a error like "Incorrect syntax near 'tes1'." --script DECLARE @command varchar(1000) SELECT @command = 'IF ''?'' NOT IN(''master'', ''model'', ''msdb'', ''tempdb'') BEGIN USE ? UPDATE dbo.mytable SET mycolumn1=''test'' WHERE mycolumn=''tes1''' EXEC sp_MSforeachdb @command Please let me know is that anything wrong in the above script?
(comments are locked)
|
|
You need an END statement since you have a BEGIN statement. Oh thanks. I think i need to take a coffee:-)
Jan 29 '10 at 02:56 PM
Akbar
2nd set of eyes solves lots of problems.
Jan 29 '10 at 03:34 PM
Grant Fritchey ♦♦
So does a cup of coffee ;)
Jan 30 '10 at 07:56 PM
TimothyAWiseman
(comments are locked)
|

