Copy structure and data of a table in SQL Server 2008
For copying structure and data both from another table in Sql Server 2008, you can execute the following sql query:
select * into newtablename from oldtablename
you don't need to create the new table before you execute the query. It will be created automatically after executing this. Refresh the object explorer and it will come automatically.
select * into newtablename from oldtablename
you don't need to create the new table before you execute the query. It will be created automatically after executing this. Refresh the object explorer and it will come automatically.
That was really a helpful one...thanx buddy.
ReplyDeleteDo you know how to do with with constraints?
ReplyDeleteDid you try with import and export data tool from SQL Server 2008? You can easily do that with that tool.
ReplyDelete