List All Databases

To list all databases in a SQL Server instance, run the following:

[cc lang=”sql”]
SELECT *
FROM sys.sysdatabases
[/cc]

This also outputs metadata about each database including createdate, compatibility level, and the MDF filename.

Featured Articles

 Site Author

  • Thanks for visiting!
css.php