Using sp_help, sp_helpindex, sp_helptext, and sp_spaceused gives a quick SQL Server tour before you reach for catalog views.
SQL SERVER – Find Number of Rows and Disk Space Reserved – Using sp_spaceused Interesting Observation
sp_spaceused shows the row count of a table and the disk space reserved. Here is why its numbers looked wrong on AdventureWorks and how @updateusage fixed them.
SQL SERVER – 2008 – 2005 – Find Longest Running Query – TSQL
My company owner asked which query runs longest and I found no ready script, so I wrote one: the Longest Running Query with its average and maximum time.
Rolling Date Ranges Forward Without Hard-Coded Years
Replace hard-coded years with indexed date ranges for current periods, full months, year-to-date comparisons, and any requested year.
SQL SERVER – Simple Use of Cursor to Print All Stored Procedures of Database Including Schema
An improved script to print all stored procedures of database, now with schema names. Jerry Hung’s cursor uses sys.all_objects and sp_HelpText.
SQL SERVER – Simple Use of Cursor to Print All Stored Procedures of Database
A simple cursor with sp_HelpText can print all stored procedures of your database. Switch results to text view with CTRL+T to read them easily.







