A reader asked how to get a single random number for a set of rows, like one per PostalCode. I compare NEWID() for each row with RAND() for a whole set.
Connecting to SQL Server From Java, Python and .NET
Choose a SQL Server driver for Java, Python, or .NET, then verify encryption, authentication, pooling, and the application's connection.
SQL SERVER – Shrinking NDF and MDF Files – A Safe Operation
Is shrinking NDF and MDF files safe? A reader asked if it causes data loss. It does not, but I explain why shrinking them is often not a good idea.
SQL SERVER – 2008 – 2005 – Find Longest Running Query – TSQL – Part 2
An updated script to find the longest running query in SQL Server 2005 and 2008, with the divide by zero error fixed and time now shown in milliseconds.
SQL SERVER – Rules for Optimizining Any Query – Best Practices for Query Optimization
My quick rules for query optimization: a primary key, a clustered index, the right non-clustered indexes, fewer views and triggers, and other simple checks.
SQL SERVER – Difference Between Index Scan and Index Seek
What is the difference between Index Scan and Index Seek? I explain how SQL Server uses search predicates to decide which index operation a query gets.
SQL SERVER – Remove Duplicate Entry from Comma Delimited String – UDF
A simple UDF from reader Ashish Jain that removes duplicate entries from a comma delimited string by turning it into a table and using DISTINCT.







