Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

Copy Table From One DATABASES To Another


To Copy a table across DATABASE use this Query-

SELECT * INTO  <Database>.dbo.<Table>  FROM  <Database>.dbo.<ExistingTable>

Example:
SELECT * INTO  pubs.dbo.CustomersTemp  FROM   Northwind.dbo.Employees

Though the use of above Query will not will transfer Data and Schema but it will not transfer Indexes , Keys etc.
To do that you have to generate the Script of that table and then copy and execute this Script  in the other Database.


This post first appeared on ASP.NET CODES, please read the originial post: here

Share the post

Copy Table From One DATABASES To Another

×

Subscribe to Asp.net Codes

Get updates delivered right to your inbox!

Thank you for your subscription

×