A simple but accurate SQL Server 2005 script to find unused indexes in the current database, since unused indexes slow down INSERT and UPDATE statements.
NULL Sort Order: Put Missing Values Where Readers Expect
NULL sort order uses a CASE bucket to put missing values last. Keep a stable tie breaker and preserve the original score.
SQL SERVER – Import CSV File Into SQL Server Using Bulk Insert – Load Comma Delimited File Into SQL Server
How to import CSV file data into SQL Server with BULK INSERT: create a table, point to the comma delimited file and load every row in a few quick steps.
SQL SERVER – Simple Example of WHILE Loop with BREAK and CONTINUE
A very simple example of WHILE Loop with BREAK and CONTINUE, plus a Books Online sample that uses a SELECT query in the WHILE condition.
SQL SERVER – Find All The User Defined Functions (UDF) in a Database
A very simple script that lists all the User Defined Functions in a database, with schema name and type, by reading sys.objects in SQL Server.
binary Conversion: Strings and Numbers Pad on Different Sides
binary Conversion pads and truncates on different sides depending on the source type. I compare one integer with one string at two target widths. The resulting byte sequences show why width alone is not the complete rule.
REPLICATE: Zero Copies and Negative Counts Differ
REPLICATE treats zero copies differently from a negative count. I keep the source and requested count beside the result. Byte lengths and NULL flags reveal several blank-looking outcomes.







