SQL server

Run command for all databases on an instance.

This query uses the sp_MSforeachdb undocumented stored proc. Similarly there is sp_MSforeachTable

exec sp_MSforeachdb “use [?];select filename from sys.sysfiles”
For a list of undocumented SQL procs check out this post:

Advertisements
Standard

Thinking about someting? Leave a Reply...

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s