Message
 
 
To
All
General information
Forum:
Microsoft SQL Server
Category:
Database management
Title:
Foreign Key Constraint
Miscellaneous
Thread ID:
01457746
Message ID:
01457746
Views:
90
Hi,

Can anybody see what is wrong with the following statement to create a foreign constraint:
use [MyDatabase]
go
alter table [dbo].[Activity] add constraint [FK_Activity_Reference]
foreign key ([Reference])
references [dbo].[luActivReference] ([ActivRefer])
The error message I get is:
The ALTER TABLE statement conflicted with the FOREIGN KEY constraint "FK_Activity_Reference". 
The conflict occurred in database "MyDatabase", table "dbo.luActivReference", column 'ActivRefer'.
What should I be looking for in the column ActivRefer?
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Next
Reply
Map
View