ASKER
ASKER
.....
set @strSQL = 'select friend, ' + @cols + ' into yournewtable from (
select friend, state, 1 as cnt from yourtable) o
pivot (count(cnt) for state in (' + @cols + ')) as p'
....
ASKER
Microsoft SQL Server 2005 is a suite of relational database management system (RDBMS) products providing multi-user database access functionality.Component services include integration (SSIS), reporting (SSRS), analysis (SSAS), data quality, master data, T-SQL and performance tuning. It includes support for managing XML data and allows a database server to be exposed over web services using Tabular Data Stream (TDS) packets encapsulated within SOAP (protocol) requests.
TRUSTED BY
Open in new window