Which way to select only date part from DATETIME is faster? After more tests on large tables, I now suggest the DATEADD and DATEDIFF method over CONVERT.
SQL SERVER – Downgrade Database to Previous Version
Can you downgrade database files from SQL Server 2005 to 2000? No tool does it. Install the old version, recreate the schema and move the data yourself.
SQL SERVER – Introduction and Example of UNION and UNION ALL
A simple example of UNION and UNION ALL with two table variables. UNION removes the duplicate rows, while UNION ALL keeps every row from both tables.
SQL SERVER – 2008 – Enhenced TRIM() Function – Remove Trailing Spaces, Leading Spaces, White Space, Tabs, Carriage Returns, Line Feeds
Need to remove trailing spaces, leading spaces, tabs, carriage returns and line feeds? Here is an enhanced TRIM function built from a script by Russ and Erik.
SQL SERVER – 2008 – Find If Index is Being Used in Database
How do you find if an index is being used in your database? My quick script checks sys.dm_db_index_usage_stats, so you can drop unused indexes safely.
SQL SERVER – Guidelines and Coding Standards Part – 2
Part 2 of my Guidelines and Coding Standards: nest single quotes, add parentheses for readability, use IF EXISTS with SELECT 1, and avoid the SP_ prefix.
SQL SERVER – Guidelines and Coding Standards Part 1
Guidelines and Coding Standards Part 1: Pascal naming for tables, and naming patterns for stored procedures, triggers, indexes and keys.






