Author |
Topic |
learntsql
524 Posts |
Posted - 2010-06-08 : 06:50:05
|
--I have the following data in Excel sheet and to be loaded into SQL Server table--Sampledata:declare @salesdata table (Policytype varchar(50),Branch varchar(50),Date1 int,date2 int,date3 int)insert into @salesdataselect 'P1','Branch1',10000,20000,30000union allselect 'P2','Branch2',12000,40000,35000union allselect 'P3','Branch3',13000,29000,60000union allselect 'P4','Branch4',16000,23000,40000union allselect 'P5','Branch5',11000,21000,20000--Here Date1,Date2,Date3 are the datevalyes for Eg.MM-DD-YYYY format as column names----I have to load this data into destination table with the following structuredeclare @Output table (Policytype varchar(50),Branch varchar(50),Date datetime,SaleValue int)insert into @Outputselect 'P1','Branch1','06-08-2010',10000union allselect 'P1','Branch1','06-09-2010',20000union allselect 'P1','Branch1','06-10-2010',30000union allselect 'P2','Branch2','06-08-2010',12000union allselect 'P2','Branch2','06-09-2010',40000union allselect 'P2','Branch2','06-10-2010',35000select * from @OutputPlease guide me.TIA. |
|
learntsql
524 Posts |
Posted - 2010-06-09 : 00:10:37
|
Hi All,Any Ideas please..... |
|
|
|
|
|