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

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 ADD CONSTRAINT Primary Key not showing in EM

Author  Topic 

LemonLunch
Starting Member

2 Posts

Posted - 2007-10-02 : 13:42:22
I run the following code in Query Analyzer to replace a primary key
in a table.

Use BaseWsoftData
ALTER TABLE PickerWork DROP CONSTRAINT PK_PickerWork
go
ALTER TABLE PickerWork
ADD CONSTRAINT PK_PickerWork PRIMARY KEY CLUSTERED
(
[Id] ,
[PickModule] ,
[PickerNumber]
)
ON [PRIMARY]
go
SQL VERISON: 8.00.760

I get a "The command(s) completed successfully" from QA.
The primary key does show correctly if
I double click for the table properties in Enterprise Manager(EM).
but when I go into EM table Design Mode the primary key does
not show. When I exit table design mode, EM asks me to save my changes when I didn't make any via EM.

How can I make the primary key show up in design mode in EM?
What am I doing wrong?

Thanks

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2007-10-02 : 14:57:37
When you say it does not show in design mode, do you mean the little key icon doesn't appear across your 3 columns?

Are you sure you don't have multiple PickerWork tables that are perhaps owned by different accounts?

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/
Go to Top of Page

LemonLunch
Starting Member

2 Posts

Posted - 2007-10-02 : 15:24:54
Hi Tara, Yes the 3 little key icons do not show in design mode(EM) and
the primary key constraint name , PK_PickerWork, does NOT show
in Selected index: drop down box.

I deleted the table and recreated the table , added the composite primary key via EM
and than ran the alter script and it worked just fine. The little key icons were back.
I must have corrupted something with my alter table add constraint code.

Thank you for responding.
Go to Top of Page
   

- Advertisement -