BUG: The Generate Wizard in Microsoft Visio does not create the "Unique index with constraint on top" index in a SQL Server database (811589)
The information in this article applies to:
- Microsoft Visio for Enterprise Architects (2002)
- Microsoft SQL Server 2000 (all editions)
SYMPTOMSIn Microsoft Visio, you create a database model diagram that has an Entity shape and the diagram contains a Unique
index with constraint on top index. When you try use the Generate Wizard to generate a Microsoft SQL Server 2000 database for the database model
diagram, SQL Server does not
create the index successfully. Additionally, if you validate your database model diagram after you generate the
database, you may receive the
following message during the logical validation of the database model
diagram: warning L4005: Index Name:
Alternate key on table Table Name and alternate key Index Name
(on same table) are functionally identical. CAUSEThis problem occurs because SQL Server does not support
Unique index with constraint on top indexes. Therefore, when you try to generate the database for your
database model diagram, the index is divided into two parts. The first part is the unique index, and the second part is the unique constraint. However, the unique index part and
the unique constraint part have the same name. Therefore, SQL Server does not
create the unique constraint successfully because it already created a unique index that
has the same name.WORKAROUNDTo work around this problem, provide different names for the
unique index and the unique constraint of the Unique index with constraint on top index, and then generate the database for the database model
diagram. To do so, follow these steps:
- Start Microsoft Visio.
- On the File menu, point to
New, point to Database, and then click
Database Model Diagram.
- In the left pane, under Entity
Relationship, drag an Entity shape to the drawing
page.
- Add two columns (col1 and col2) to the Entity shape, and then make sure that the first column (col1) is defined as a Primary Key.
- Create a new index on the second column (col2), and then set the following properties:
- For the Index name property, set the value to index1.
- For the Index type property, set the value to Unique index with constraint on top.
- Click the index1 index, and then click Rename.
- Type different names in the Index name box and in the
Unique constraint name box, and then click
OK.
- On the Database menu, click
Generate, and then follow the instructions in the
Generate Wizard to generate the SQL Server
database.
STATUS
Microsoft has confirmed that this is a bug in the Microsoft products that are
listed at the beginning of this article.
Modification Type: | Major | Last Reviewed: | 1/28/2004 |
---|
Keywords: | kbDatabase kberrmsg kbBug KB811589 kbAudDeveloper |
---|
|