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
 Database Design and Application Architecture
 Table structure & SP to retrive it back in pivot

Author  Topic 

Ajit Bodhani
Starting Member

1 Post

Posted - 2014-07-04 : 10:06:34
Hi Team,
Please suggest me to create appropriate table structure to store data and which type of query suppose to use to retrieve it back in the same format.

Input and output of the data
Code |Jan_2014_Activity1 | Jan_2014_Activity2 |.... |Dec_2015_Activity2
XX25 | 12.50 | 5.42 |.... | 10.66

Note :
1)there are 7 activities
2)max columns is near about 150
3)Max rows in 1000's
4)If current month is Jun 2014 then it will take historical data from table for Jan 14 to May 14 and rest of the columns filled from last May 14 data.

Thanks & Regards,
Ajit
   

- Advertisement -