How are GUIDs compared in SQL Server 2005?

In general, equality comparisons make a lot of sense with uniqueidentifier values. However, if you find yourself needing general ordering, then you might be looking at the wrong data type and should consider various integer types instead. If, after careful thought, you decide to order on a uniqueidentifier column, you might be surprised by what…

4

Sorting undefined characters in Unicode and/or Windows collation

When comparing two Unicode strings in non-binary collations, SQL Server uses a library that is essentially same as the Windows API CompareStringW. It defines a weight for each recognized character, and then use the weights to compare characters. However, not all code points are defined in the sorting library. They may be undefined because:  …

1

Multiplication and Division with Numerics

It can be surprising to see certain results when doing numeric arithmetic: declare @num1 numeric(38,10)declare @num2 numeric(38,10)set @num1 = .0000006set @num2 = 1.0select cast( @num1 * @num2 as numeric(38,10)) Yields:             .0000010000 Instead of:      .0000006000 Why? Well, Books Online (see Precision, Scale, and Length) dictates the following rule for numeric arithmetics: Operation Result precision Result scale * e1…

1

Newsequentialid (Histrory/Benefits and Implementation)

            In general, we made significant improvements in SQL Server scalability during Yukon.  One of the areas of improvement is replication scalability.  While doing merge replication testing we found out that scaling was severely affected by high number of I/O operations.  The cause of the problem was that new rows were inserted in random disk…

15