BUG: ISQL Problems with PRINT in Stored Procedures

Last reviewed: April 28, 1997
Article ID: Q89938

The information in this article applies to:
  • Microsoft SQL Server version 4.2 for OS/2
  • Microsoft SQL Server, versions 4.21 and 4.21a
BUG# OS/2: 7404 (4.2)
       NT: 7406 (4.2)

SYMPTOMS

The ISQL utility may behave unexpectedly when a PRINT statement is the last statement in a stored procedure.

For example, create a stored procedure "sp_test" as follows:

   Create procedure sp_test as
   select * from sysdatabases where 1=2
   print "End of Procedure"

When sp_test is executed, isql produces the following output

   End of Procedure
   <column header for sysdatabases>

The output from ISQL should be:

   <column header for sysdatabases>
   (0 rows affected)
   End of Procedure

This problem occurs only when the stored procedure has a SELECT statement immediately prior to the PRINT statement and the SELECT statement does not return any rows.

STATUS

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


Additional query words: stored procedure ISQL
Keywords : kbtool SSrvISQL
Version : 4.2 | 4.21 4.21a
Platform : OS/2 WINDOWS


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: April 28, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.