Microsoft KB Archive/155181

= BUG: AV Using Insert With Correlated Subquery and Check Option =

Article ID: 155181

Article Last Modified on 10/3/2003

-

APPLIES TO


 * Microsoft SQL Server 6.5 Standard Edition

-



This article was previously published under Q155181





SYMPTOMS
If you insert into a view, which has a correlated subquery preceded by the IN operator and which has been created with the WITH CHECK OPTION, a handled Access Violation error occurs.



WORKAROUND
Do not use the WITH CHECK OPTION or rewrite the correlated subquery in the view as a Join.



STATUS
Microsoft has confirmed this to be a problem in Microsoft SQL Server versions 6.0 and 6.5. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.



MORE INFORMATION
Consider the following script:

create table X (xCol1 int not null,                  xCol2 int not null) go  create table Y (yCol1 int not null) go  create view vX   as      select xCol1, xCol2 from X     where xCol1 in         (select yCol1         from Y         where yCol1 = xCol1) with check option go

The following query causes a handled access violation:

insert vX values (1,1)

Additional query words: AV

Keywords: kbbug kbprogramming KB155181

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.