Tuesday, February 2, 2010

What does the COLLATE keyword in SQL signify?

Collation is the order that SQL Server uses for sorting or comparing textual data. The temporary database is a system database that inherits it’s collation order from the master. If this temp table is compared to a real one, SQL Server will inform that it cannot resolve collation conflict on = operation.
To solve this, the tables should be created using the COLLATE keyword. 

What is COMPUTE and WITH TIES clause in SQL?

The COMPUTE clause is placed at the end of a query to place the result of an aggregate function at the end of a listing.
e.g.: COMPUTE SUM (TOTAL)
The SELECT TOP N query always return exactly N records, and arbitrarily drops any record that have the same value as the last record in the group. The WITH TIES clause can do away with this. It returns the records that have the same value even if the number declared after the TOP has been exceeded.

0 Comments: