Skip to content

Feature request: Option to ignore parameters in error checking #19096

Open
@philipnye

Description

@philipnye
  • MSSQL Extension Version: 1.30.0
  • VSCode Version: 1.99.0 (user setup)
  • OS Version: Windows_NT x64 10.0.26100

Steps to Reproduce:

  1. Save a SQL query that contains parameters - e.g.:
select *
from customers
where
    name = ?
  1. Error checking flags this as an error.

Rationale

Including parameters in SQL scripts like this is useful, to allow SQL queries to be run as part of Python scripts, for example, with parameters provided. The only way that I'm aware of that would disable these errors is to disable error checking overall by the MSSQL extension, but then that would turn off helpful flagging of legitimate errors. But not being able to disable them leaves us with visually distracting flagging of things as errors when they're not really problems.

This has been raised previously, but back in 2018. The suggestion there was that it might be possible to use SQLCMD variables like '$(myVar)' - but this only serves the use case where the script is to be run with parameters in SQLCMD mode. It would be great if a setting could be added that allowed other types of parameter (possible following user-specified formats?) to be ignored in error checking.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions