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
 SQL Server 2008 Forums
 Transact-SQL (2008)
 How to pivot one table into another?

Author  Topic 

Bill_C
Constraint Violating Yak Guru

299 Posts

Posted - 2010-07-01 : 02:23:40
I have two tables,
Table1 - which has one column and 36828960 rows.
Table2 - which has 1120 columns (sparse) and no data in it.

The data in table one has collectively datasets (rows converted to columns) in 1120 chunks, i.e. one record = 1120 rows of data.
(this was imported (via a vb routine) from a csv which contained 1120 columns, and as 1120 columns is above the threshold for directly importing into sql server so I had to go the vb route to import this file)

I want to copy the data from Table1 into Table2, any idea on how to do this?

Thanks



Edit - There are 32,883 records in Table1, each record is 1120 fields wide.

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2010-07-01 : 08:15:50
will you be able to use the PIVOT operator for this ?


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page
   

- Advertisement -