BUG: Dynamic Execution with Long Comments May Fail with AV

ID: Q166916


The information in this article applies to:

BUG #: 15706

SYMPTOMS

Dynamic execution of a Transact-SQL command with comments from a stored procedure may fail with an access violation (AV). You will receive the following error message at the client:

language_exec: Process # generated access violation;
SQL Server is terminating this process
DB-Library Process Dead - Connection Broken

You will find the following error message in the error log on the server, followed by the stack dump information:
Error : 0, Severity: 19, State: 0
language_exec: Process 11 generated access violation;
SQL Server is terminating this process



WORKAROUND

To work around this problem, either move the comments around or shorten the comments.


STATUS

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


MORE INFORMATION

The following two sample scripts demonstrate the problem:


CREATE PROCEDURE sp_updateAuthors
AS
EXEC("
UPDATE authors
SET n.au_fname = o.au_fname,
n.au_lname = o.au_lname,
n.au_id = o.au_id,
n.phone = o.phone,
n.address = o.address,
n.city = o.city,
n.state = o.state
FROM authors o, authors n
/*12345678901234567890123456789012345678901234567890
12345678901234567890123456789012345678901234567890
12345678901234567890123456789012345678901234567890
12345678901234567890123456789012345678901234567890
12345678901234567890*/ 
")
GO
CREATE PROCEDURE sp_selectAuthors
AS
EXEC("
SELECT *
FROM authors a
WHERE a.au_id IS NOT NULL and
a.au_fname IS NOT NULL and
a.au_lname IS NOT NULL and
a.au_id IS NOT NULL and
a.phone IS NOT NULL and
a.address IS NOT NULL and
a.city IS NOT NULL and
a.state IS NOT NULL
/*12345678901234567890123456789012345678901234567890
12345678901234567890123456789012345678901234567890
1234567890123456789012345678901234567890123456
*/ 
")
   GO 


Keywords          : kbusage SSrvStProc SSrvTran_SQL kbbug6.00 
Version           : 6.0
Platform          : WINDOWS 
Issue type        : kbbug 

Last Reviewed: April 9, 1999