May 3, 2006 at 12:08 pm
I need to update the same filed in about 40 databases to Yes (1) at the some time based on a query. Any thoughts?????
May 3, 2006 at 12:58 pm
Create linked servers to all servers that count and depending on the results of your query , update the fields on the server in question using the linked servers
Mike
May 3, 2006 at 1:13 pm
They are on the same server, just diffrent databases. I can not use a union because I am updating
May 3, 2006 at 1:27 pm
Look into sp_msforeachdb. It would work something like this:
sp_msforeachdb 'if ''?'' not in (''master'', ''model'', ''msdb'', ''tempdb'')
update ?.dbo.table1 set column = ''yes'' '
May 4, 2006 at 6:08 am
I did not know about that procedure. That is awesome. Thanks
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply