BUG: Constraint Violation Is Not Detected If Update with the Same Data

ID: Q238146


The information in this article applies to:

BUG #: 56110 (SQLBUG_70)

SYMPTOMS

In SQL Server 7.0, you do not receive an error message if you perform an update by setting a column to itself against a table that contains FOREIGN KEY constraint violation data. However, in SQL Server 6.5, you receive the following error:

547 16 UPDATE statement conflicted with COLUMN FOREIGN KEY constraint '%.*s'.The conflict occurred in database '%.*s', table '%.*s'


STATUS

Microsoft has confirmed this to be a problem in SQL Server version 7.0.


MORE INFORMATION

Steps to Reproduce the Problem

To reproduce this problem, run the following script:

use pubs
go

alter table titleauthor nocheck constraint all
go

update titleauthor set title_id='invalid' where title_id='BU1111'
go

alter table titleauthor check constraint all
go

update titleauthor set title_id = title_id
go 
RESULTS: You do not get an error even if a table contains constraint violation data.

Additional query words: err msg violate const constr fkey fk valid invalid validate


Keywords          : SSrvDRI kbbug7.00 kbSQLServ700bug 
Version           : winnt:7.0
Platform          : winnt 
Issue type        : kbbug 

Last Reviewed: July 29, 1999