BUG: Stored Proc. Generates Access Violation with Bound Rule

ID: Q125876

The information in this article applies to: BUG# NT: 972 (4.2)

SYMPTOMS

The following stored procedure may generate access violations when executed with a rule bound to a column on the table.

the table : create table rde_testtab3

   (col1   int
   ,col2   varchar(255)
   ,col3   datetime
   ,col4   bit
   ,col5   timestamp)

the stored procedure : create procedure testparams;5
   (@c1 int=NULL,
    @c2 varchar(255)=NULL,
    @c3 datetime=NULL,
    @c4 tinyint=NULL,
    @wh int)
      as
        BEGIN
          select @c1 = ISNULL(@c1,col1),
                   @c2 = ISNULL(@c2,col2),
                   @c3 = ISNULL(@c3,col3),
                   @c4 = ISNULL(@c4,col4),
         @wh = @wh
         from rde_testtab3
          where col1 = @wh

          update rde_testtab3
     set col1 = @c1,
         col2 = @c2,
         col3 = @c3,
         col4 = @c4
          where col1 = @wh
     END

the rule (bound to column 2) :
   create rule mr_NotBlank as (ltrim(rtrim(@value)) != '')

The following execution of the stored procedure has produced the access violation:

   exec testparams;5 @c3='1/5/95', @wh=20668

STATUS

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

Additional query words: Windows NT

Keywords          : kbprg SSrvStProc kbbug4.20 SSrvWinNT 
Version           : 4.2 4.21 4.21a 4.21a.sp1
Platform          : WINDOWS

Last Reviewed: May 1, 1997