Technical Article


sp_XTAB (prototype) produces pivoted (crosstab) views/output with a minimum of fuss.No messing with code, just tell XTAB what you want to pivot.Tested to 764 pivoted columns, XTAB can generate up to 63000 characters of dynamic sql. Example (deliberately over-simplified)----------------------updated 27 January 2004Use NorthwindEXEC sp_XTAB 'Northwind','xtEMPL_COUNTRY','Orders','EmployeeID','ShipCountry', '', 'OrderID','COUNT','NULL', '', 'SELECT xtEMPL_COUNTRY.* FROM xtEMPL_COUNTRY' -- Include optional […]


379 reads


Daily Coping 23 Sep 2022


Today’s coping tip is to notice what you are feeling without any judgment. Today...

Snowflake – Where is the explain/execution plan?


Whatever your database background is you will have heard of an execution / explain...

Daily Coping 22 Sep 2022


Today’s coping tip is to ask a trusted friend to tell you what strengths...

Read the latest Blogs


Couldn't allocate new page for database alert even the Database has free space

By ramana3327

Hi, We have a database. We received the alert Could not allocate new page...

Best Approach to move the databases in Always On

By ramana3327

Hi, We have Always on Server with one primary & 1 secondary ( Not...

Help with SQL

By don075

I need to display 1 or 0 for the first occurrence of a certain...

Visit the forum

Ask SSC Logo Ask SSC

SQL Server Q&A from the SQLServerCentral community

Get answers