I forgot the syntax to check the two digit year cutoff, so I listed all Server Wide Configurations with sys.configurations. A small script worth saving.
Using sp_help and Friends to Explore a Database
Using sp_help, sp_helpindex, sp_helptext, and sp_spaceused gives a quick SQL Server tour before you reach for catalog views.
SQL SERVER – 2008 – 2005 – Find Longest Running Query – TSQL – Part 2
An updated script to find the longest running query in SQL Server 2005 and 2008, with the divide by zero error fixed and time now shown in milliseconds.
SQL SERVER – Find Row Count in Table – Find Largest Table in Database – T-SQL
A quick script using sys.dm_db_partition_stats that lists the row count of every table and shows the largest table in database right at the top.
Exploring the System Catalog With Queries
Exploring the system catalog with queries reveals SQL Server objects, columns, indexes, and dependencies without relying on stale diagrams.
SQL SERVER – Renaming SP is Not Good Idea – Renaming Stored Procedure Does Not Update sys.procedures
Renaming Stored Procedure objects with sp_rename looks fine, but the stored definition keeps the old name, as sp_helptext shows. A quick demo on AdventureWorks.
SQL SERVER – Find Primary Key Using SQL Server Management Studio
Need to drop a primary key but do not know the constraint name? Imran Mohammed shows how to find primary key details using SQL Server Management Studio.







