Microsoft KB Archive/295006

= FIX : OSQL Utility Returns Incorrect Error Message =

Article ID: 295006

Article Last Modified on 11/5/2003

-

APPLIES TO


 * Microsoft SQL Server 2000 Standard Edition

-



This article was previously published under Q295006



BUG #: 353107 (SHILOH_BUGS)



SYMPTOMS
When the OSQL utility is used to execute a query that is longer than 1002 characters, an incorrect error message may be returned:

Msg 3909, Level 16, State 1, Server Server_Name, Procedure sp_bindsession, Line 0

Session binding token is invalid.

The correct error message should be the following:

Input query is too long



CAUSE
The input buffer for the OSQL utility is limited to 1002 characters.



RESOLUTION
To resolve this problem, obtain the latest service pack for SQL Server 2000. For additional information, click the following article number to view the article in the Microsoft Knowledge Base:

290211 INF: How to Obtain the Latest SQL Server 2000 Service Pack



WORKAROUND
To work around this problem, you can do the following:
 * Specify an input query that is shorter than 1002 characters.
 * Place the batch in an input file and pass the input file name to OSQL with the /i parameter.



STATUS
Microsoft has confirmed that this is a problem in SQL Server 2000. This problem was first corrected in SQL Server 2000 Service Pack 1.



MORE INFORMATION
This problem does not occur on Microsoft Windows 95 and Windows 98 because these operating systems cannot handle a command-line argument that is greater than 1002 characters. If an argument of that length is specified at the command prompt, or in a batch file, it is truncated by the operating system.

Keywords: kbbug kbfix kbsqlserv2000sp1fix KB295006

-

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

© Microsoft Corporation. All rights reserved.