Get basic information about a database – SQL Server

Sometimes you need to get basic information, like compatibility_level, collation_name, database state etc.,  about a database. Sys.databases is good table to start from, this table contains all this and much more information like why the log file is growing, recovery model.

SELECT * FROM sys.databases
WHERE name = 'database_name'

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>