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 |
|
asm
Posting Yak Master
140 Posts |
Posted - 2005-11-08 : 00:15:03
|
| HiI have two table both table contains data.Now i want to insert data from one table to another table.Pls help how can i achive the same.i have try this query but this will delete the all data.select class.* into grop from classthanksasm |
|
|
chiragkhabaria
Master Smack Fu Yak Hacker
1907 Posts |
Posted - 2005-11-08 : 00:19:26
|
| Try this.. Insert GropSelect * From ClassOr Insert Grop (Column_Name.....)Select Column_Name ... From ClassOR Insert Grop Select Column_Name .. From ClassHopee this works for you.Complicated things can be done by simple thinking |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2005-11-08 : 00:21:58
|
| You need to create the table before using that Insert statementOtherwise run thisSelect * into grop from classMadhivananFailing to plan is Planning to fail |
 |
|
|
asm
Posting Yak Master
140 Posts |
Posted - 2005-11-08 : 01:49:17
|
| No one query is working...asm |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2005-11-08 : 01:51:45
|
| What is the error you get?Give more detailsMadhivananFailing to plan is Planning to fail |
 |
|
|
chiragkhabaria
Master Smack Fu Yak Hacker
1907 Posts |
Posted - 2005-11-08 : 02:01:17
|
| Are you getting the duplication errors???If so then you can try out the following query .. Insert GropSelect * From Class Where UnquieKey Not In (Select UnqueKey From Grop) ???Or specify the error in more details.Complicated things can be done by simple thinking |
 |
|
|
asm
Posting Yak Master
140 Posts |
Posted - 2005-11-08 : 02:01:51
|
| thanks problem has been solved...asm |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2005-11-08 : 02:10:04
|
| Use Exists alsoInsert GropSelect * From Class C Where not exists (Select UnqueKey From Grop where key=C.key) MadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|