Hi,
Could someone please tell me if this can be done in a query? I know how to
accomplish this using Enterprise Manager, but what I need to do is have it
done programmatically.
Thanks,
Stevecreate database a
go
create database b
go
create table a.dbo.mytable(id int)
go
create table b.dbo.mytable(id int)
go
insert b.dbo.mytable
select * from a.dbo.mytable
go
"Steve Caliendo" <scaliendo@.epion.com> wrote in message
news:OCQ1BjHVEHA.3692@.TK2MSFTNGP09.phx.gbl...
> Hi,
> Could someone please tell me if this can be done in a query? I know how
to
> accomplish this using Enterprise Manager, but what I need to do is have it
> done programmatically.
> Thanks,
> Steve
>|||I forgot to show you this other way:
select *
into b.dbo.mytable2
from a.dbo.mytable
go
Note that this won't copy indexes, constraints, etc.
"Steve Caliendo" <scaliendo@.epion.com> wrote in message
news:OCQ1BjHVEHA.3692@.TK2MSFTNGP09.phx.gbl...
> Hi,
> Could someone please tell me if this can be done in a query? I know how
to
> accomplish this using Enterprise Manager, but what I need to do is have it
> done programmatically.
> Thanks,
> Steve
>
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment