all groups > sql server programming > september 2004 >
You're in the

sql server programming

group:

Getting rid of the Unique identifier Constraint


Getting rid of the Unique identifier Constraint Nuve
9/14/2004 9:21:10 PM
sql server programming:
what is the t-sql command for getting rid of a Unique Identifier Constraint
on a table?

What I'm trying to do is append the contents of a table into another and I
want the the unique identifiers populated as but cannot drop the constraint
to do this within the same stored procedure.

Please Help
RE: Getting rid of the Unique identifier Constraint John Bell
9/15/2004 12:09:03 AM
Hi

If you want to drop the unique identifier then there is an issue with the
design of the database or your process. You can insert rows from another
table that don't already exist in your table by using NOT EXISTS in your
where clause. If there are duplicates in the table you are loading from, then
you should either delete rows using some specific criteria or SELECT DISTINCT
rows.

You can remove a unique contraint by using ALTER TABLE ... DROP CONSTRAINT ...
see Books Online for more details

If you are really talking about inserting into a IDENTITY column then look
at SET IDENTITY_INSERT in Books Online.

John


[quoted text, click to view]
AddThis Social Bookmark Button