The following are examples of T-SQL coding. I've placed this here both for others to review and also for me to have a central place I can store my coding examples. Remember, your memory is the second thing to go. Some of these clipits were taken from other peoples examples and some where written by me and were tested/used using SQL Server 2005 and 2008. I do not claim to have authored these examples. When available or possible, I have tried to give credit to the original author. Also, use these examples at your own risk. I do not claim the accuracy of these examples. All I know is that they help me from time to time in my development.

SQL Queries
  • NewExamples of random SQL Queries to accomplish specific tasks using SQL Server or Microsoft Access. (Examples)
SQL Scripts
  • NewRebuild_Indexes.sql - Rebuild all indexes for all tables in a database. (Source)
Stored Procedures:
Table-Valued Functions:
Scalar-Valued Functions: