What are the repercussions of not checking existing data when adding a foreign key?

Posted by scottm on Stack Overflow See other posts from Stack Overflow or by scottm
Published on 2010-05-07T15:14:51Z Indexed on 2010/05/07 15:18 UTC
Read the original article Hit count: 191

Filed under:
|

I've inherited a database that doesn't exactly strive for data integrity. I am trying to add some foreign keys to change that, but there is data in some tables that doesn't fit the constraints. Most likely, the data won't be used again so I want to know what problems I might face by leaving it there. The other option I see is to move it into some kind of table without referential constraints, just for historical purposes.

So, what are the repercussions of not checking existing data?

If I create a foreign key constraint on a table and don't check existing data, will all new data inserted into the table be enforced?

© Stack Overflow or respective owner

Related posts about mssql-2005

Related posts about foreign-keys