http://www.databasejournal.com/news/article.php/3722461/Run-The-Same-SQL-Command-Against-All-Databases.htm
Run The Same SQL Command Against All DatabasesJanuary 17, 2008 [From MSSQLTips]There are times when I find myself needing to run a SQL command against each database on one of my SQL Server instances. There is a handy undocumented stored procedure that allows you to do this without needing to set up a cursor against your sysdatabases table in the master database: sp_MSforeachdb. The article continues at http://www.mssqltips.com/tip.asp?tip=1414 |
The Network for Technology Professionals
Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | E-mail Offers