FIX : OSQL Utility Returns Incorrect Error Message

This article was previously published under Q295006
This article has been archived. It is offered "as is" and will no longer be updated.
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 theMicrosoft 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.
Properties

Article ID: 295006 - Last Review: 01/16/2015 22:15:19 - Revision: 3.2

Microsoft SQL Server 2000 Standard Edition

  • kbnosurvey kbarchive kbbug kbfix kbsqlserv2000sp1fix KB295006
Feedback