Created
July 7, 2021 14:28
-
-
Save dariusz-wozniak/7bb63480fd441cd656f7a206441fdbc2 to your computer and use it in GitHub Desktop.
List user server databases in SQL Server
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT * | |
FROM master.sys.databases | |
WHERE Cast(CASE WHEN name IN ('master', 'model', 'msdb', 'tempdb') THEN 1 ELSE is_distributor END As bit) = 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment