Monthly Archives: October 2005

Pivot and unpivot data: PIVOT and UNPIVOT operator

One of the new features that SQL server 2005 has is PIVOT and UNPIVOT operator. <pivot_clause> ::=         ( aggregate_function ( value_column )         FOR pivot_column         IN ( <column_list> )   <unpivot_clause> ::=        ( value_column FOR pivot_column   IN ( … Continue reading

Posted in SQL server 2005 | Leave a comment

The problem of SET ROWCOUNT

In the previous entry, I said SET ROWCOUNT has its own prblem. Let’s talk about this now.   If you query data from udf, the problem is the row count limit is applied to the the udf first. Since the … Continue reading

Posted in SQL server | 1 Comment

TSQL enhancement: TOP x

In SQL 2k, when you TOP in SELECT statement, it must follow a constant integer number or a number and PERCENT keyword. It’s syntax is: TOP integer | integer PERCENT  [ WITH TIES ]   E.g.: USE NorthwindGOSELECT TOP 10 … Continue reading

Posted in SQL server 2005 | 1 Comment

cannot generate SSPI context

When a client is connecting to SQL server via trusted connection, sometimes you can get this error. There is a good article about this (http://www.sqlservercentral.com/columnists/cmiller/cannotgeneratesspicontext.asp). It described several scenarios that can cause the issue and how to fix it.   … Continue reading

Posted in SQL server | 2 Comments