Copy table with same structure with different name in same database
Hi,
I want to copy table with same structure with different name in same database by using c#.net. I tried it by using microsoft SQL Server Management Object (SMO) but get error against column's parent property.
Is there any way to achieve this.
Thanks
Kirtan PatelPosted Oct 9, 2009, 8:47 AM
and use it in programming :)
VikramPosted Oct 9, 2009, 8:40 AM
Rajeswari nathanPosted Oct 9, 2009, 8:34 AM
SELECT * INTO ForumUsers1 FROM ForumUsers WHERE 1=2
SELECT * INTO MyUsers1 FROM MyUsers WHERE 1=2
VikramPosted Oct 9, 2009, 8:22 AM
Rajeswari nathanPosted Oct 9, 2009, 8:22 AM
VikramPosted Oct 9, 2009, 8:18 AM
Rajeswari nathanPosted Oct 9, 2009, 8:15 AM
open the script in the SQL query ananyzer and change the table name only..
you will get new table with old structor. I think you catch my point..
Kirtan PatelPosted Oct 9, 2009, 8:11 AM
Here is What you want
dont forget to mark "Do you like this Answer" please if answer helped you :)
you can Copy Table Structure only By following Query to Server ..
select * into newTable from source where 1=2;