Object type has no primary reference scheme.

D

Dave Routledge

Hi

I am modelling an existing database using ORSM, some tables of which
have no primary key. When I do an Update Source Model, Visio seems to
refuse to believe me and takes the first Not-Null column it finds and
makes this the primary key of the table. If I try to remove the
constraint in the ORSM and rebuild, it fails with the error in the
subject of this post.

Is there any way around this that anyone knows of - other than the
obvious "tell your DBA to add primary keys", which is not an option for
me?

Many thanks in advance anyone,

Dave
 
C

Chang Oh

Theoretically, a table with no primary key is really an anomally. Since ORM
is in a way a strongly conceptual method, an entity (table equivalent)
without primary reference scheme would is illegal. However, you can select
the constraint with P designation and change its mapping option property to
Not a Key, which will result in a table with no primary key. Note that the
graphical notation for ER will appear as though there is a primary key, but
the Primary ID tab of the table will say that the primary key will be
generated as No Key.

An important bit of information. To be able to do what I illustrated here,
you will not be able to do this on an entity with referece mode. To
circumvent this limitation, you can manually expand to a one to 1 reference
fact type. For example, Person(ssn) can be expanded to "Person is
identified by SSN" with mandatory Person role and 1:1 uniqueness constraints
where the UC on SSN is designated as Primary Identificatoin.

Chang Oh
Visual Studio Team Architect
--
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm

Note: For the benefit of the community-at-large, all responses to this
message are best directed to the newsgroup/thread from which they
originated.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top