Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 run script

Author  Topic 

arkiboys
Master Smack Fu Yak Hacker

1433 Posts

Posted - 2009-05-11 : 04:43:16
Hello,
How is it possible to run a sql script agains the sql server names which are held in a table of a database?
For example:
table1 contains the names of the sql server machines.
I would like to have a sql to connect to each machine in the table and then run the script on that sql server.

Please note that I do not want to create linked servers as the names in the table get changed.
Any thoughts please?
Thanks

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-05-11 : 11:32:04
cant you just add a execute sql task in ssis and add package configuration for server,databse names of connection manger and read it from your table at runtime to connect to appropriate instances and execute the script?
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-05-11 : 11:42:25
also see

http://www.mssqltips.com/tip.asp?tip=1405
Go to Top of Page

arkiboys
Master Smack Fu Yak Hacker

1433 Posts

Posted - 2009-05-11 : 14:58:21
quote:
Originally posted by visakh16

cant you just add a execute sql task in ssis and add package configuration for server,databse names of connection manger and read it from your table at runtime to connect to appropriate instances and execute the script?


For business reasons I have to just run it in sql.
May be I have to do this in osql ?
Go to Top of Page
   

- Advertisement -