The GetProcessInputBuffer method of a SQLServer object returns a "Language buffer" string instead of the contents of the language buffer. In Microsoft SQL Server 6.5 the GetProcessInputBuffer method works correctly and returns the correct contents of the language buffer.
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
SQL Server 7.0
To resolve this problem, obtain the latest service pack for Microsoft SQL Server 7.0. For additional information, click the following article number to view the article in theMicrosoft Knowledge Base:
301511 INF: How to Obtain the Latest SQL Server 7.0 Service Pack
To work around this behavior either:
Use the DBCC INPUTBUFFER statement to retrieve the inputbuffer of the server process ID (SPID). For example:
Set oQueryResults = oSQLServer.ExecuteWithResults("dbcc Inputbuffer("&str$(spid) & ")")
Use the following Microsoft Visual Basic code, which works around the problem:
Private Sub Command1_Click() Dim oSQLServer As SQLDMO.SQLServer Set oSQLServer = New SQLDMO.SQLServer oSQLServer.LoginSecure = True oSQLServer.Connect "(local)" Debug.Print InputBuffer(7, oSQLServer)End SubPrivate Function InputBuffer(spid As Long, ByRef oSQLServer As SQLDMO.SQLServer) As String Dim oQueryResults As SQLDMO.QueryResults Set oQueryResults = oSQLServer.ExecuteWithResults("dbcc inputbuffer(" & Str$(spid) & ")") If (oQueryResults.Rows <> 1) Then InputBuffer = "" Else InputBuffer = oQueryResults.GetColumnString(1, 3) End If Set oQueryResults = NothingEnd Function
Microsoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article.
SQL Server 2000 This problem was first corrected in SQL Server 2000 Service Pack 1.
SQL Server 7.0 This problem was first corrected in Microsoft SQL Server 7.0 Service Pack 4.