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
 Insert value of each column as row in other table?

Author  Topic 

Vaishu
Posting Yak Master

178 Posts

Posted - 2008-09-03 : 10:09:28
HI

I have planned to use triggers for the below scnario.

I have tbl1 - col1 - col2 - col3 - col4,......col25
................Tab --mas ---DAN --
.....................--Tab ---SAN -- ZAP
................Man --DAN ---mas -- ZIG

From the above table I have 4 colums with data(some of them NUll or Empty).


I have another tbl2 - colA,ColB,ColC...ColM

My question: How do I insert a row from tbl1 into tbl2 for columns (Col1,col2,col3,col4) which has value in tbl1.

ex: col1,col2,col3 in first row of tbl1 . So need to enter the data into tbl2 as folows when data inserted to tbl1(Need to insert 3 rows to tbl2 because 3 out of 4 columns has value in tbl2)

1. Tab,.....etc
2. mas,.....etc
3. DAN,.....etc

nathans
Aged Yak Warrior

938 Posts

Posted - 2008-09-03 : 13:09:40
Please see: http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=3914

Nathan Skerl
Go to Top of Page
   

- Advertisement -