Home Dashboard Directory Help
Search

SSMS : bad client-side errors by AaronBertrand


Status: 

Closed
 as Won't Fix Help for as Won't Fix


4
0
Sign in
to vote
Type: Bug
ID: 361659
Opened: 8/13/2008 9:40:39 AM
Access Restriction: Public
1
Workaround(s)
view
3
User(s) can reproduce this bug

Description

I am running queries using Management Studio (2008 RTM) against a remote SQL Server 2005 instance (9.0.3050). When trying to run a query like SELECT * FROM sys.databases, I am getting strange errors that interrupt the retrieval of results. Typically 5 rows will come back, and then SSMS will stop processing the query, move to the error pane, and show an error like this:

An error occurred while executing batch. Error message is: Invalid array size.

Or this:

An error occurred while executing batch. Error message is: Internal connection fatal error.

Or this:

An error occurred while executing batch. Error message is: Non-negative number required.
Parameter name: count

I have a suspicion that this has something to do with network protocols, because if I connect to my VPN and route to the remote server that way, everything works fine. If I disconnect from the VPN, the errors return. Opening a new SSMS instance does not help.

I don't necessarily want you to try to fix my issue, because I understand that this is not going to be an easy one to reproduce. But I think we need a better way to debug these things on the client side. In the short term, can you describe to me what part of the code path would have to be hit, in order for these error messages to be returned from SSMS? Obviously those error messages were coded by someone, to be returned for a specific event. This knowledge would allow me to debug the problem myself, assuming it is not isolated to the internals of SSMS.

In the long term, can I suggest some kind of logging mechanism for SSMS, so that when it comes across errors and other events, they can be logged somewhere with more diagnostic information? This would allow for easier debugging and would provide evidence that is better than a screen shot. I imagine I will file a separate enhancement suggestion for that one.

Thanks for listening,
Aaron Bertrand, SQL Server MVP
Details
Sign in to post a comment.
Posted by Microsoft on 4/20/2011 at 10:42 AM
Hi aaronbertrand
Thanks for taking the time to let us know about this. Our developers have been able to reproduce the problem. However, after extensive investigation, we've decided there's not a whole lot SSMS can do to provide significantly better error messages when there are these kind of (usually connection) errors.

If we come up with any brilliant ideas, we'll make sure to reconsider this for a future release.

-Sam Hughes
Posted by Ion Freeman on 6/5/2009 at 8:26 AM
Aaron, did you ever get any response? I was already to blame this on the Visual Studio 2010 Beta install. I'm just trying to run 'SELECT SYSTEM_USER' in 2008 SSMS against a SQL Server 2005 database, and getting the error box

TITLE: Microsoft SQL Server Management Studio
------------------------------

Cannot execute script.

------------------------------
ADDITIONAL INFORMATION:

Unable to start the Transact-SQL debugger. The Transact-SQL debugger does not support SQL Server 2005 or earlier versions of SQL Server. (SQLEditors)

------------------------------
BUTTONS:

OK
------------------------------

Show Technical Details/All Messages/Details gives me
===================================

Cannot execute script.

===================================

Unable to start the Transact-SQL debugger. The Transact-SQL debugger does not support SQL Server 2005 or earlier versions of SQL Server. (SQLEditors)

------------------------------
Program Location:

at Microsoft.SqlServer.Management.UI.VSIntegration.Editors.ScriptAndResultsEditorControl.DebugWrapper.Start()
at Microsoft.SqlServer.Management.UI.VSIntegration.Editors.ScriptAndResultsEditorControl.OnDebugScript(Object sender, EventArgs a)

So, naturally I want to disable Visual Studio integration. It's not clear how.
Posted by AaronBertrand on 8/27/2008 at 4:29 PM
Today I got a new error while trying to reproduce:

An error occurred while executing batch. Error message is: SqlDateTime overflow. Must be between 1/1/1753 12:00:00 AM and 12/31/9999 11:59:59 PM.

Of course I cannot debug because the server is SQL Server 2005. When I try to debug (before it even gets to the permissions check, which would fail) I get:

TITLE: Microsoft SQL Server Management Studio
------------------------------

Cannot execute script.

------------------------------
ADDITIONAL INFORMATION:

Unable to start the Transact-SQL debugger. The Transact-SQL debugger does not support SQL Server 2005 or earlier versions of SQL Server. (SQLEditors)
Posted by AaronBertrand on 8/27/2008 at 4:01 PM
Thanks Eric, I cannot turn debugging on as the remote server is a shared hosting SQL Server and as such I do not have appropriate permissions.
Posted by Microsoft on 8/27/2008 at 10:15 AM
aaronbertrand,

The error message format indicates it is client side (SSMS) issue. Do you have a permission to run the query in debugging mode?

Regards,
Eric
Sign in to post a workaround.
Posted by ABHI_HP14 on 8/16/2009 at 9:52 PM
Try to get the query result in text /file
File Name Submitted By Submitted On File Size  
ess_3.gif (restricted) 8/13/2008 -
ess_3.gif (restricted) 8/13/2008 -
ess_1.gif (restricted) 8/13/2008 -
ess_2.gif (restricted) 8/13/2008 -