Sunday, February 19, 2012

Copy tables?

Hello!
Pls tell me how to copy a table (want to have another table with another
name, but has the same structure).
Thanks for your help!
select * into NewTable from OldTable where 1 = 0
"Chi Pheo" <chipheo2k@.mail.ru> wrote in message
news:uRXezz1wEHA.3612@.tk2msftngp13.phx.gbl...
> Hello!
> Pls tell me how to copy a table (want to have another table with another
> name, but has the same structure).
> Thanks for your help!
>
|||Problem with this solution is that it won't create any indexes or constraints.
You can use the Enterprise Manager Generate Script, change the name in the
script, and INSERT INTO new table FROM old table. Or use a Copy Object task
in DTS.
Sincerely,
Anthony Thomas
"John Ryan" wrote:

> select * into NewTable from OldTable where 1 = 0
> "Chi Pheo" <chipheo2k@.mail.ru> wrote in message
> news:uRXezz1wEHA.3612@.tk2msftngp13.phx.gbl...
>
>
|||OK, thanks so much!
"AnthonyThomas" <AnthonyThomas@.discussions.microsoft.com> /
:
news:9E63270A-F95C-4605-82FE-ABA22859A7FC@.microsoft.com...
> Problem with this solution is that it won't create any indexes or
constraints.
> You can use the Enterprise Manager Generate Script, change the name in the
> script, and INSERT INTO new table FROM old table. Or use a Copy Object
task[vbcol=seagreen]
> in DTS.
> Sincerely,
>
> Anthony Thomas
> "John Ryan" wrote:
another[vbcol=seagreen]

No comments:

Post a Comment