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 |
|
newbie123
Starting Member
2 Posts |
Posted - 2012-08-13 : 12:33:52
|
| Table Name: RelationData:ID ID1 ID21 602 51 602 4021 602 4031 602 4071 602 4911 602 4921 602 4932 602 22 602 4022 602 4032 602 4072 602 4912 602 4922 602 493...What I would like to do is append the following data to the same table , they are same as those record with ID=2, the only difference is ID=33 602 23 602 4023 602 4033 602 4073 602 4913 602 4923 602 493Is there a SQL statement can achieve that? I tried insert into and update but not successful.Appreciate for any help :)newbie |
|
|
sunitabeck
Master Smack Fu Yak Hacker
5155 Posts |
Posted - 2012-08-13 : 12:42:33
|
Run the parts starting at SELECT in the following first. That will show you exactly what is going to be inserted into the table. Then if you are satisfied, run the whole statement:INSERT INTO RelationSELECT 3 AS ID, ID1, ID2FROM RelationWHERE ID = 2; |
 |
|
|
newbie123
Starting Member
2 Posts |
Posted - 2012-08-13 : 13:59:44
|
| Works, thx! |
 |
|
|
|
|
|