ReIndexing Database tables starts with a measured maintenance need. I check the workload before choosing an index operation.
SQL SERVER – Query Analyzer Short Cut to display the text of Stored Procedure
A quick Query Analyzer shortcut: map sp_helptext to a key, select any SP name and display the text of Stored Procedure right in the result window.
SQL SERVER – SQL Joke, SQL Humor, SQL Laugh
A short SQL joke I found on DavidM’s blog on SQLTeam: roll call at DBMS school, and MySQL rushes in late because it thought it was February 31st.
SQRT: Keep Fractional Roots in the Result
SQRT produces an approximate square root. These read-only examples preserve fractional roots, state the display precision and distinguish a missing input from zero.
SQL SERVER – Query to find number Rows, Columns, ByteSize for each table in the current database – Find Biggest Table in Database
A query to find the biggest table in database: it lists row count, column count and data size for each table using sp_spaceused, sorted by data size.
SQL SERVER – Simple Example of Cursor
The simple example of cursor I have used for years: declare it, open it, fetch each Account_ID in a WHILE loop, then close and deallocate the cursor.
SQL SERVER – Shrinking Truncate Log File – Log Full
The old code I used to truncate log file space with DBCC SHRINKFILE and BACKUP LOG WITH TRUNCATE_ONLY. It breaks the log chain, so take a full backup after.







