netoops blog

Monday, 29 October 2012

How to Create a Duplicate Table with New Name from Existing table programmatically???


Create Table with All Data and same Field Name

SELECT *

INTO [LoginDetailRecreate]

FROM [LoginDetail]


Create Blank Table with Same Field Name

SELECT *

INTO [LoginDetailRecreate]

FROM [LoginDetail]

WHERE 1 = 2



Here, 1=2 will prevent the data from being copyied from LoginDetail to the LoginDetailRecreate table.


Try it

No comments:

Post a Comment

Related Posts Plugin for WordPress, Blogger...