Re: TSQL - Alter table to add a clustered prime key index
From: Wayne Snyder (wayne.nospam.snyder_at_mariner-usa.com)
Date: 09/10/04
- Next message: Jaap: "Re: Left characters from -"
- Previous message: Wayne Snyder: "Re: Non-modifiable index/field values"
- In reply to: Rob: "TSQL - Alter table to add a clustered prime key index"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 10 Sep 2004 06:28:36 -0400
to further explain your problems,
You can not have two constraints in a single definition ( Check and Primary
Key)
with Nocheck is not allowed with PK and unique constraints
Good luck
-- Wayne Snyder, MCDBA, SQL Server MVP Mariner, Charlotte, NC www.mariner-usa.com (Please respond only to the newsgroups.) I support the Professional Association of SQL Server (PASS) and it's community of SQL Server professionals. www.sqlpass.org "Rob" <Rob@discussions.microsoft.com> wrote in message news:8C0DF46F-DDDA-4681-A065-1B6B6D32B6A2@microsoft.com... > Hello All, > > I'm struggling to work out how to create a clustered prime key constraint on > an exisitent column in an existing SQL Server 2000 table. > I need to do this in TSQL otherwise I would change the table design in > Enterprise Manager. > I've been playing with the syntax, but I just can't seem to nail it. > > My current TSQL is : > > ALTER TABLE USERS WITH NOCHECK ADD CONSTRAINT PK_USERS CHECK USERCODE > PRIMARY KEY CLUSTERED > > TableName = USERS > PrimeKeyColumnName = USERCODE > DesiredPrimeKeyName = PK_USERS > > Any help much appreciated. > > Best Regards, > > Rob
- Next message: Jaap: "Re: Left characters from -"
- Previous message: Wayne Snyder: "Re: Non-modifiable index/field values"
- In reply to: Rob: "TSQL - Alter table to add a clustered prime key index"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|
Loading