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 |
|
Gigi
Starting Member
23 Posts |
Posted - 2009-05-04 : 12:23:06
|
| I have a table with 7 Columns and I want to create a duplicate row for each row. I can create the duplicate rows but there is some manupilation that I need to do to the duplicate record when creating them . The changes for the duplicated column will beCol1 should be changed to text 'XYZ'Col2 = Col3 from original rowCol3 = Col2 from original rowCol5 = Col5 from original row + 1 thank you in advance |
|
|
jimf
Master Smack Fu Yak Hacker
2875 Posts |
Posted - 2009-05-04 : 12:41:51
|
| INSERT INTO yourTable(Col1,Col2,Col3,Col5)SELECT 'XYZ',Cols3,Col2,Col5 + 1FROM yourTableJim |
 |
|
|
Gigi
Starting Member
23 Posts |
Posted - 2009-05-04 : 12:58:16
|
| thank you...worked perfectly |
 |
|
|
|
|
|