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.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 How to copy only the data

Author  Topic 

skiabox
Posting Yak Master

169 Posts

Posted - 2008-12-09 : 18:05:43
How can I copy only the data of some columns from one table to another?

I tried :

SELECT *
INTO new_table
FROM old_table

but this script works only if new_table does not exist.

Thank you.

sodeep
Master Smack Fu Yak Hacker

7174 Posts

Posted - 2008-12-09 : 18:09:13
Insert into anothertable(some columns...)
select somecol1,somecol2... from onetable
Go to Top of Page

skiabox
Posting Yak Master

169 Posts

Posted - 2008-12-09 : 18:20:54
Thank you very much sodeep.
It worked!
Go to Top of Page
   

- Advertisement -