>Thanks for your fast reply
>I place several new sp in one file named update.sqlor update.txt
>
>how can I can Call this sql programically
>Thanks
>such as
>Use branch1
>do update.sqll...... etc
Agnes,
Create a stored procedure in the master database and put the script into the procedure. You will have to do a little re-writing to get rid of USE and GO from within the script.
Once you have a stored procedure that performs the changes, use sp_MSforeachDB to run the procedure in every database.
exec sp_MSforeachdb 'exec master.dbo.sp_myProc'