Groups | Blog | Home
all groups > sql server msde > july 2004 >

sql server msde : Primary Keys


Aaron [SQL Server MVP]
7/27/2004 9:55:00 AM
[quoted text, click to view]

What does this mean? How are you trying to "turn them on"? What tool are
you using, and are you using ALTER TABLE or clicking buttons in a GUI? Are
you getting an error message? If so, what is it?

--
http://www.aspfaq.com/
(Reverse address to reply.)

Aaron [SQL Server MVP]
7/27/2004 10:39:55 AM
If you can use osql or isql to connect to MSDE, you can issue an ALTER TABLE
/ ADD CONSTRAINT command, which isn't limited by what an application thinks
you should/shouldn't be able to do. Barring that, you can create a dummy
table with the primary key intact, copy the data over, drop the old table,
and rename the new table. If these tools will let you do those things too,
of course.

--
http://www.aspfaq.com/
(Reverse address to reply.)




[quoted text, click to view]

June Macleod
7/27/2004 2:35:44 PM
I have managed to confuse myself as to when and how you can set up Primary
Keys on an MSDE database.

Are Primary Keys only used when you are connected to an MS Access project or
can they be used in other places.

I come from an MS Access background and am familure with the use of Primary
Keys my problem is that I cannot seem to turn them on. I already have a
clustered index set up on the table and am using Identidy to declare a field
as unique. Could this be the reason why I cannot turn on the Primary Key
option?

Any insight would be useful.

Thanks

June

June Macleod
7/27/2004 3:40:06 PM
I have tried using Andrea Montanari's DbaMGR2k and Microsoft Web Data
Administrator.
Using DbaMGR2k - When logged on as dbo I cannot check the checkbox beside
Primary Key although I can change all the other field settings. There is no
message, simply nothing happens.

Using Microsoft Web Data - when editing a table I can set the Primary Key
only on tables that have no rows of data in them. As soon as there is data
in the table the option to edit the fields is removed.

I want to be able to set up Primary Keys and Foreign Keys in order to set up
a relationship. I also want my tables to have a clustered index which in
most, but not all, cases will be the same field as the Primary Key.


[quoted text, click to view]

Andrea Montanari
7/27/2004 5:23:59 PM
hi June,
"June Macleod" <junework@hotmail.com> ha scritto nel messaggio
news:eKX7Vb%23cEHA.1644@tk2msftngp13.phx.gbl...
[quoted text, click to view]

as regard DbaMgr2k, the help file specifies the Primary Key can not be set
in the "Table Management" window, where the check is read only, but in the
Indexes/Keys/Check window =;-D
so you have to access that window, both for PKs and indexes management as
for Foreign Keys management, as DbaMgr2k does not implement Diagrams
management [ =:-( , I know ]

[quoted text, click to view]

yes, you are right... WDA will not allow you to edit existing columns when
the base table is populated (sqlwish@microsoft.com =;-D )

[quoted text, click to view]

and you can do it... with WDA you have to resort on executing Transact-SQL
statements, becouse it only supports PK setting (AFAIK)... with my tool you
can do it both graphically (but not in the Table Management window =;-D)
and/or performing Transact-SQL statements execution...
--
Andrea Montanari (Microsoft MVP - SQL Server)
http://www.asql.biz/DbaMgr.shtm http://italy.mvps.org
DbaMgr2k ver 0.8.0 - DbaMgr ver 0.54.0
(my vb6+sql-dmo little try to provide MS MSDE 1.0 and MSDE 2000 a visual
interface)
--------- remove DMO to reply
June Macleod
8/2/2004 1:39:41 PM
[quoted text, click to view]

Thank you, that works

June

AddThis Social Bookmark Button