T-SQL To Get Database Information

Here is the small piece of code to get some handy information on databases on SQL Server Instance

select d.[name] as [Database], l.[name] as [Owner], d.compatibility_level as [Cmpt Lvl],
d.recovery_model_desc as [Recovery], d.state_desc as [Status],
f.size/128 as [Size(MB)], f.physical_name as [Data file Path] from sys.server_principals as l right outer join
sys.databases as d on l.sid = d.owner_sid inner join sys.master_files as f on d.database_id = f.database_id
where f.type <> 1 order by d.[name], l.[name], d.compatibility_level, d.recovery_model_desc,
d.state_desc, f.size, f.physical_name