Skip to content

Intellisense doesn't work on Database that has a Synonym about broken Linked Server #19035

Open
@ruby3141

Description

@ruby3141
  • MSSQL Extension Version: v1.29.1
  • VSCode Version: v1.98.2
  • OS Version: Windows_NT x64 10.0.26100

Steps to Reproduce:

  1. Suppose you have some required permission over a MSSQL server. Mine was v16.0.1006.6.
  2. Add a new Linked Server on MSSQL server. Mine used "Microsoft OLE DB Provider for SQL Server".
  3. Add a Synonym about the Linked Server on some random database, like [dbo].[SomeData] for [1.2.3.4].[SomeData].[dbo].[SomeData].
  4. Make the Linked Server irresponsive. I don't know why for mine but I think it was some IP address changes.
  5. Try refreshing Intellisense cache about the database on VSCode and you'll see that it has completely bricked.
  6. Delete the Synonym(It took three days for me to be authorized to do that. 🤦) and everything got back to normal.

Try querying select * from sys.sysprocesses while doing MS SQL: Refresh IntelliSense Cache and find this OLEDB wait.
Image

With that sql_handle I called sys.fn_get_sql() to get the command, remove the parameterized where parts, ran it, and got this result.
Image

This bug also occurs in SSMS(v20.2.30.0) (AFAIK sqltools service and SSMS uses same query),
but at least it doesn't completely brick intellisense.

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions