Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Update one SP in many databases
Message
De
19/03/2007 10:09:59
Keith Payne
Technical Marketing Solutions
Floride, États-Unis
 
 
À
16/03/2007 03:59:39
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Autre
Divers
Thread ID:
01204396
Message ID:
01205486
Vues:
19
>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'
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform