Query on Float DataType may return inconsistent result

Let us try following T-SQL script on SQL Server: declare @a float =300000000000000000000000000000000000select @a + 50 -@aselect @a -@a +50go Guess what is the result?  the first is 0. and the second result  is 50. Floating point data is approximate; therefore, not all values in the data type range can be represented exactly. When you…

20

Tertiary Collation and the performance impact on order clause

Today, One customer asked about collation SQL_Latin1_General_CP1_CI_AI with non unique nonclustered index we are getting a sort on the query plan.  The sample script is: CREATE TABLE TableWithASColumn(ID INT PRIMARY KEY, CharData VARCHAR(100) COLLATE SQL_Latin1_General_CP1_CI_AS) CREATE NONCLUSTERED INDEX IX_CharData ON TableWithASColumn(CharData) CREATE TABLE TableWithAIColumn(ID INT PRIMARY KEY,CharData VARCHAR(100) COLLATE SQL_Latin1_General_CP1_CI_AI) CREATE NONCLUSTERED INDEX IX_CharData ON…

0