Home > Archive > microsoft.public.sqlserver.server > October 2002 > Changing Primary Key





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Changing Primary Key
Paul rust

2002-10-05, 9:07 pm

I would appreciate if anybody can give me the correct
syntax (if possible) to change a primary key of a table.
I want to amend the PK so that it ignores duplicate rows
on inserts
Tibor Karaszi

2002-10-05, 9:07 pm

Paul,

I don't think that this is possible in a PK declaration. You would have to create an index
instead and specify IGNORE_DUP_KEY.

--
Tibor Karaszi, SQL Server MVP
Archive at: http://groups.google.com/groups?oi=...ublic.sqlserver


"Paul rust" <Paul.Rust@cargosc.co.uk> wrote in message
news:e17701c25991$c6787bf0$36e
f2ecf@tkmsftngxa12...
> I would appreciate if anybody can give me the correct
> syntax (if possible) to change a primary key of a table.
> I want to amend the PK so that it ignores duplicate rows
> on inserts



Geoff N. Hiten

2002-10-05, 9:07 pm

No can do. Primary Key implies unique values. If you want to index on that
column, drop the PK and add a non-unique index.

--
Geoff N. Hiten
Senior Database Administrator
Careerbuilder.com




"Paul rust" <Paul.Rust@cargosc.co.uk> wrote in message
news:e17701c25991$c6787bf0$36e
f2ecf@tkmsftngxa12...
> I would appreciate if anybody can give me the correct
> syntax (if possible) to change a primary key of a table.
> I want to amend the PK so that it ignores duplicate rows
> on inserts



Sponsored Links





Free Braindumps | MCSE braindumps software forum

Copyright 2003 - 2008 examnotes.net