Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

sp_MSForEachDB

Status
Not open for further replies.

DBAWinnipeg

Programmer
Joined
Apr 14, 2004
Messages
173
Location
CA
This neat little stored procedure used to be on SQL 6.5 I think... and I haven't seen anything similar in 2000... is there such a function or does someone have a cursor/code they've developed for running a script on multiple databases?




Thanks in advance!!!

Colin in da 'Peg :)
 
You could also call this stored proc in SQL 2000 and SQL 7.0, it's a very famous undocumented stored proceudure.

 
sp_MSForeachdb

it appears "red" in a query analyzer window but I get this message

Server: Msg 2812, Level 16, State 62, Line 1
Could not find stored procedure 'sp_MSForeachdb'.

Ideas?

Thanks in advance!!!

Colin in da 'Peg :)
 
sp_MSForEachDb resides in Master database, sometimes due to company policy they would remove this kind of stored procedure. Because it's so powerful, some inexperienced IT staff may mis-use it.

Check out Object browser to see whether this stored procedure still exists or not.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top