Results 1 to 3 of 3

Thread: foreign key in SQL Server

  1. #1
    Resty
    Guest

    foreign key in SQL Server

    is it possible to create a foreign key in SQL Server wherein the
    fields being define as the reference is not a primary key?

  2. #2
    Fanatic Member vb_dba's Avatar
    Join Date
    Jun 2001
    Location
    Somewhere aloft between the real world and insanity
    Posts
    1,016
    Try creating a unique constraint on the referenced column. Even though I can't find where I've done this before, I'm pretty sure it will work.

    Chris

  3. #3
    Resty
    Guest

    Thumbs down

    We cannot create the unique constraint because the records in the fields are not unique either. we could have easily defnied them as primary key if they weren't.

    Thanks for your help anyway.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width