SQL Server 2008: The columns in table do not match an existing primary key or unique constraint

Posted by 109221793 on Stack Overflow See other posts from Stack Overflow or by 109221793
Published on 2011-01-12T10:41:08Z Indexed on 2011/01/12 10:53 UTC
Read the original article Hit count: 182

Hi guys,

I need to make some changes to a SQL Server 2008 database.

This requires the creation of a new table, and inserting a foreign key in the new table that references the Primary key of an already existing table. So I want to set up a relationship between my new tblTwo, which references the primary key of tblOne.

However when I tried to do this (through SQL Server Management Studio) I got the following error:

The columns in table 'tblOne' do not match an existing primary key or UNIQUE constraint

I'm not really sure what this means, and I was wondering if there was any way around it?

© Stack Overflow or respective owner

Related posts about sql

Related posts about sql-server