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.
| Author |
Topic |
|
frank.svs
Constraint Violating Yak Guru
368 Posts |
Posted - 2008-08-21 : 03:15:11
|
| Dear Pals ,I have a small requirement, I have two tables "test" and "trg" drop table test create table test ( col1 varchar(10), col2 varchar(10), col3 varchar(10), col4 varchar(10))insert into test select 'a','b','c','d'union allselect 'e','f','g','h'select * from test-- Output /*col1 col2 col3 col4 a b c de f g h*/I have one more table create table trg(id int identity(1,1), col varchar(10))I need to data to be loaded into "trg" table as below select * from trg id col-------1 a2 b3 c4 d5 e6 f7 g8 hCan anyone help me out?Thanks in Advance. |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2008-08-21 : 03:45:38
|
| insert into trg(col)select col1 from testunion allselect col2 from testunion allselect col3 from testunion allselect col4 from testMadhivananFailing to plan is Planning to fail |
 |
|
|
frank.svs
Constraint Violating Yak Guru
368 Posts |
Posted - 2008-08-21 : 04:45:35
|
| Thank You! |
 |
|
|
|
|
|