Perform operation on all databases on a server/ins
Sometime one needs to perform an operation on all or selected databases on a server/instance. Microsoft provides undocumented store proc sp_MSForEachDb to achieve this. I use it for some clean up process as a SQL Job.
2002-11-30
446 reads