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- Examples of random SQL Queries to accomplish specific tasks using SQL Server or Microsoft Access. (Examples)
- Rebuild_Indexes.sql - Rebuild all indexes for all tables in a database. (Source)
- usp_DirFolder - Returns the filenames contained in the passed Folder name. (Source)
- uft_ParseString - Returns a table with parsed elements in a passed string. (Source)
- uft_ReadFileAsTable - Returns a table with each line from the text file written to a row in the table. (Source)