A quick script on sys.master_files to find the size of database file and log file in MB. Remove the WHERE clause to see every database on the server.
SQL SERVER – Get the List of Object Dependencies – sp_depends and information_schema.routines
sp_depends can return wrong dependency results where information_schema.routines gets it right. See where it fails and the DMVs recommended in its place.
SQL SERVER – Location of Resource Database in SQL Server Editions
The Resource database contains SQL Server system objects. I use version-specific guidance to locate its files and plan recovery.
SQL SERVER – Recently Executed T-SQL Query
fn_get_sql() and DBCC INPUTBUFFER will be deprecated. Use sys.dm_exec_query_stats and sys.dm_exec_sql_text to see each recently executed T-SQL query.
sys.objects, sys.all_objects and sys.system_objects
Compare sys.objects, sys.all_objects and sys.system_objects to find SQL Server user objects, system objects, and metadata visibility gaps.
SQL SERVER – Get Query Plan Along with Query Text and Execution Count
A handy script that shows each query’s text, its execution count and its query plan, so you can see what runs most often on your server.
SQL SERVER – Get Last Running Query Based on SPID
How to see the last running query of another session based on its SPID, using @@SPID to find session IDs and DBCC INPUTBUFFER to read the query.







