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 PatelRank #292 · 8.6K reputationPosted Oct 9, 2009, 4:11 AM EDT
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;
Rajeswari nathan97 reputationPosted Oct 9, 2009, 4:15 AM EDT
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..
VikramRank #9,295 · 208 reputationPosted Oct 9, 2009, 4:18 AM EDT
Rajeswari nathan97 reputationPosted Oct 9, 2009, 4:22 AM EDT
VikramRank #9,295 · 208 reputationPosted Oct 9, 2009, 4:22 AM EDT
Rajeswari nathan97 reputationPosted Oct 9, 2009, 4:34 AM EDT
SELECT * INTO ForumUsers1 FROM ForumUsers WHERE 1=2
SELECT * INTO MyUsers1 FROM MyUsers WHERE 1=2
VikramRank #9,295 · 208 reputationPosted Oct 9, 2009, 4:40 AM EDT
Kirtan PatelRank #292 · 8.6K reputationPosted Oct 9, 2009, 4:47 AM EDT
and use it in programming :)