Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 the column in tabletbl_table1 do not match an exis

Author  Topic 

programer
Posting Yak Master

221 Posts

Posted - 2010-11-02 : 10:32:53
the column in table tbl_table1 do not match an existing primary key or UNIQUE constaint

tbl_table1
ID primarykey (autoinc)
UserId uniqueidentifier
IdNumber primarykey int

Where is the problem?

thanks.

russell
Pyro-ma-ni-yak

5072 Posts

Posted - 2010-11-02 : 20:21:33
how about you post the actual DDL for the table?

anyway, the problem is that you're trying to create a foreign key to a column in another table that isn't defined as unique or as part of a primary key.

also, and this is just a pet peeve of mine, please don't prefix table names with 'tbl'
Go to Top of Page
   

- Advertisement -