mtxr / vscode-sqltools

Database management for VSCode
https://vscode-sqltools.mteixeira.dev?utm_source=github&utm_medium=homepage-link
MIT License
1.44k stars 291 forks source link

Connection lost on SQL Server #842

Open fonnesbeck opened 2 years ago

fonnesbeck commented 2 years ago

When running most queries using the SQL Server driver, I get failures that simply return:

Connection lost - read ECONNRESET

No other information is in the console. If I run a simple query like selecting a few rows from a simple table, it returns results as expected. Anything with more structure seems to fail. Note that this occurs with working queries that run without error with other clients (e.g. Azure Data Studio), so there is nothing inherently wrong with the query or the connection. However, the lack of information makes it difficult for me to debug this myself.

Desktop:

gjsjohnmurray commented 1 year ago

Are you still able to reproduce this with latest VS Code and extension versions?

jermwormza commented 3 months ago

At the risk of being flamed for posting on a closed ticket (due to lack of response by OP) but not wanting to create another ticket with the same issue.

I have the same issue when trying to execute long queries e.g. long update queries where I have generated the update SQL from an Excel sheet and paste many updates that should run in sequence.

It appears to break if the query is >4000 characters

Also the SQL Console only seems to show the result of the last query executed.

Yes I know I can solve this in many different ways, I usually just open and paste into SSMS instead.

gjsjohnmurray commented 2 months ago

@jermwormza I will reopen the issue but don't currently have capacity to investigate.

fzhem commented 1 month ago

ECONNRESET is coming from the tedious driver. There is an open issue which seems to be related to this: https://github.com/tediousjs/tedious/issues/1483.

Unfortunately at this point you can only wait for it to be fixed in the tedious library. I have a fork of the mssql driver that has msnodesqlv8 driver alongside tedious but the former is only used for windows authentication at this point.