May 24, 2019 at 1:12 pm
table1
id value
2 20
3 30
4 40
5 50
6 60
7 null
the above table has to be inserted into another table2 with following fashion
i,e: it has to insert the value corresponding to 2 into col1 when id =2 ,col2 when id=3 and so on. note: insert empty when null is the value
table2
col1 col2 col3 col4 col5 col6
20 30 40 50 60 empty
May 24, 2019 at 1:20 pm
Cross post of https://www.sqlservercentral.com/forums/topic/how-to-map-the-table-data-while-inserting-into-another-table-in-sql and https://www.sqlservercentral.com/forums/topic/how-to-map-the-table-data-while-inserting-into-another-table-in-sql-3. I suggest posting on the OP's original post.
Thom~
Excuse my typos and sometimes awful grammar. My fingers work faster than my brain does.
Larnu.uk
Viewing 2 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy