int Foreign key column data type not consistent with parent column uniqueidentifer

B

Bill Bernat

The error "Foreign key column data type not consistent with parent column"
appears every time that an int is a foreign key to a uniqueidentifier.

Do I have any options other than not using uniqueidentifier columns? That
seems a bit extreme, but I need to be able to generate the database from the
visio diagram.

I'm using Visio 2002 ea SP2. Any help would be greatly appreciated, thanks!

-billb
 
A

Anthony Bloesch

I don't know what DBMS you are targeting but my guess is that it is SQL
Server. In SQL Server Uniqueidentifiers are GUIDs so an int is
incompatible. Your options are to use GUIDs in both locations or switch to
using "int identity" on the parent column. You can do this by clicking on
the edit button on the columns property sheet>Data Type>Edit>Identity.

If you think you will ever need to use replication I would choss GUID and
mark the column as the ROWGUID.

Anthony

--
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