Friday, February 17, 2012

Copy Table from another table

How to create a Table from another Table?
I need both structure and data ?

If any one know pls rply

bye
Smilemurali
murali@.gsdindia.com

Hi,
If your using SQLServer 2000 then you could use the DTS(Data Transformation Services). you could select your source database. And select the same database for its destination. When importing a copy of your table, you must rename it...

cheers,
Paul June A. Domag|||It's not clear whether you need Integration Services in this scenario. A 'SELECT... INTO' SQL statement might be sufficient. For more information, check books online.

regards,
ash|||If you're using Integration Service, you can use the transfer objects task. It will create the table and transfer the data it contains.|||The simplest method of all for doing this is to simply use the SELECT INTO statment. Here's how:

Suppose you're trying to copy the authors table of the Pubs SQL Server database with data and structure. To do so simply use this SQL script:

--
USE Pubs
GO

SELECT *
INTO copy_of_authors
FROM authors
GO
--

Executing this script will create a table named copy_of_authors containing all data from the authors table.

Regards,

Ejan

No comments:

Post a Comment