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 |
|
CrazyT
Yak Posting Veteran
73 Posts |
Posted - 2010-04-29 : 14:06:23
|
| i am selecting and need to insert into another tableselect top 100 * from table 1I then want to take the result and insert the records into another table.is there a way to do the insert statement and select statement in one? |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
Kristen
Test
22859 Posts |
Posted - 2010-04-29 : 14:12:49
|
| [code]INSERT INTO TargetTable (Col1, Col2, ...)SELECT ColA, ColB, ...FROM Table1WHERE ...[/code]if you want to take the results from that into a THIRD insert/update/etc then you nee d to use the OUTPUT statement as well |
 |
|
|
CrazyT
Yak Posting Veteran
73 Posts |
Posted - 2010-04-29 : 14:16:22
|
| thanks -- after posting i thought about it |
 |
|
|
|
|
|