Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to create table in SQL with Constraints

Status
Not open for further replies.

ADoozer

Programmer
Dec 15, 2002
3,487
AU
Hi all...

Please see thread183-1652081

I am trying to create a table with constraints to mimic an existing table.

Any help would be greatly appreciated

If somethings hard to do, its not worth doing - Homer Simpson

Jack of all trades, king of none!
 
This is miscategorized. It should be in the SQL forum with you other post.

I'm assuming this is here because you will wind up running the table generation script from C#. You will need to look in the system tables to identfy all of the constraints that are attached to the table. You will probably need dynamic SQL.

If it is a temp table, or merely for reference, the the constraints may be overkill. If you are doing this a script out for backup or custom "restore" process, then you will want the constraints.

Lodlaiden

A lack of experience doesn't prevent you from doing a good job.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top