Skip to content

Instantly share code, notes, and snippets.

@rasor
Created April 17, 2018 11:31
Show Gist options
  • Save rasor/3db7e591090cd92bf29c6d74a0d1b768 to your computer and use it in GitHub Desktop.
Save rasor/3db7e591090cd92bf29c6d74a0d1b768 to your computer and use it in GitHub Desktop.
Print all MS SQL DB's on a server
-- Print all MS SQL DB's on a server
SELECT name FROM master.dbo.sysdatabases
WHERE name NOT IN ('master', 'tempdb', 'model', 'msdb');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment