Site Sponsored By: SQLDSC - SQL Server Desired State Configuration
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.
Hello everyoneI know you have select * into a temp table.But is there a way you can select into an existing tableRegards RobMCTS / MCITP certified
webfred
Master Smack Fu Yak Hacker
8781 Posts
Posted - 2010-08-28 : 18:47:30
insert table_nameselect ...orinsert table_name(col1,col2,col3,...)select col1,col2,col3,... from ...No, you're never too old to Yak'n'Roll if you're too young to die.
slimt_slimt
Aged Yak Warrior
746 Posts
Posted - 2010-08-29 : 03:57:17
Using statement
select * into TempTable from MyTable
can only be done into non-existing table. Therefore statement "INTO TempTable" can be used only when there is no such table as TempTable. Otherwise - if you have an existing table -, you need to use
insert TempTable (col1, col2) select col1, col2 from MyTable
. statement INTO TempTable can not be used in such premises.
masterdineen
Aged Yak Warrior
550 Posts
Posted - 2010-08-29 : 06:30:00
SOrry what i meant was.IS there a method you can select data from one permanent table into another permanent table.