Please start any new threads on our new site at We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 remove constraints
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Starting Member

2 Posts

Posted - 11/30/2012 :  01:03:55  Show Profile  Reply with Quote
hi guys,

I have a table named table1 having columns C1 (PK, int, null) and C2 (datetime, not null).
I want to write a query to copy all these columns into a new table after removing all the constraints.

Can anybody provide a solution to this ? thanks in advance.

Flowing Fount of Yak Knowledge

2242 Posts

Posted - 11/30/2012 :  01:27:10  Show Profile  Reply with Quote

-- To create duplicate table without data from an Original Table
INTO DuplicateTable
FROM table1
WHERE 1=2 -- If you want data also, then remove WHERE condition

SELECT * FROM DuplicateTable -- Table Without Constraints

Go to Top of Page
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.02 seconds. Powered By: Snitz Forums 2000