all groups > sql server (alternate) > may 2005 >
You're in the

sql server (alternate)

group:

FK on a column to a table where the column is not the PK but a Unique Index


Re: FK on a column to a table where the column is not the PK but a Unique Index David Portas
5/13/2005 12:00:00 AM
sql server (alternate):
Use a unique constraint rather than a unique index.

--
David Portas
SQL Server MVP
--

FK on a column to a table where the column is not the PK but a Unique Index gradeaaguy NO[at]SPAM aol.com
5/13/2005 1:47:11 PM
Hello everyone, I am new to ERWIN and I need helps from the experts out
there.

We are using ERWin 4.1.2771 and have reversed engineered some MS SQL
Server 2000 databases.

The problem we are having is that we have a FK on a column to a table
where the PK of the referencing table is on another column (such as an
identity column). We have a unique index on the column in the PK table
and SQL Server allows you to build a FK reference even though the
column is not defined as the PK.

Does anyone know how to create this type of FK within Erwin?

Thank You
Re: FK on a column to a table where the column is not the PK but a Unique Index --CELKO--
5/13/2005 2:26:39 PM
Standard SQL allows you to reference any UNIQUE() constraint from a
FOREIGN KEY. Indexes do not exist in Standard SQL, so be sure to use
the UNIQUE() constraint.
AddThis Social Bookmark Button