469,603 Members | 2,049 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,603 developers. It's quick & easy.

Copying a table with different column names

Hi,

I want to copy a table in my SQL server from one database to another. during this migration, I also want to change the name of the columns. Please advise me how to go about it.

Thanks
Mar 5 '08 #1
1 1272
ck9663
2,878 Expert 2GB
Hi,

I want to copy a table in my SQL server from one database to another. during this migration, I also want to change the name of the columns. Please advise me how to go about it.

Thanks
Try something like :

Expand|Select|Wrap|Line Numbers
  1. select column1 as newcolumn1, column2 as newcolumn2, column3 as newcolumn3  into db2..table2
  2. from db1..table1
-- CK
Mar 6 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

6 posts views Thread by Margaret MacDonald | last post: by
36 posts views Thread by toedipper | last post: by
4 posts views Thread by Gordon Burditt | last post: by
1 post views Thread by Jens Riedel | last post: by
8 posts views Thread by brian kaufmann | last post: by
7 posts views Thread by Serge Rielau | last post: by
reply views Thread by guiromero | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.