Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Need multiple dynamic columns

Author  Topic 

singh.guru
Starting Member

3 Posts

Posted - 2012-02-13 : 04:27:23
Dear Members,

i have a requirement where in i have to provide sp to the SSRS people
query is below:

we have a query Select [column name] from Table1

This query is returning more then 1000 records, but can we do something in the stored procedure, that can create multiple dynamic columns

for example

Column 1 Column 2 Column 3 Column 4
Record 1 Record 6 Record 11 Record 17
Record 2 Record 7 Record 12 Record 18
Record 3 Record 8 Record 13 Record 19
Record 4 Record 9 Record 14 Record 20
Record 5 Record 10 Record 16 Record 21


is this possible?

please advice






visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2012-02-13 : 09:36:36
yep. you can refer below links

http://beyondrelational.com/blogs/madhivanan/archive/2008/08/27/dynamic-pivot-in-sql-server-2005.aspx

http://beyondrelational.com/blogs/madhivanan/archive/2007/08/27/dynamic-crosstab-with-multiple-pivot-columns.aspx

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -