Skip to content

Multiple error events on bad statement preparation #133

@dhensby

Description

@dhensby

Please see tediousjs/node-mssql#973 for context.

It appears that attempting to prepare a bad statement results in two error events being emitted. For example req.prepare('SELECT col FROM spt_monitor') results in 2 errors being emitted:

  • [Microsoft][SQL Server Native Client 11.0][SQL Server]Invalid object name 'missingtable'.
  • [Microsoft][SQL Server Native Client 11.0][SQL Server]Statement(s) could not be prepared.

This is problematic because this means it is difficult to know when the connection is going to stop throwing errors and when it is ready for re-use if we don't have a maximum of one error per request via the connection.

Is there something I'm missing that I could use to know if the errors were over or could work be done to make sure connections only emit one error?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions