Skip to content

[Bug]: extension does not recognize opened file as sql #20678

@bwa

Description

@bwa

Description

Using v1.37.0
I open a file with exstension sql, but the execute query option does not work, and I'm getting this message. It clearly shows 'some' SQL , but not enough to execute.

Image

It also shows much fewer option, but a execute icon it is

Image

If I choose to create a new query

Image

and copy pase content into that editor, it works fine and executing the statemens flawlessly

Image

So for a strange reason opening a .sql file with Ctrl-O the extension is not initialized correctly. And I do have some large files, so the copy&pase option is not an option.

It must be said that the sql file has very long lines because of base 64 encoded content, so it migth the something about that. Smaller files seems to be recognized when opening with Ctrl-O.

Steps to Reproduce

Open a new VSCode window with SQL Server extension leaded
Create a Azure SQL connection
Verify the connection
Open a rather big sql file with Ctrl-O option
Try to execute it, by pressing the green run icon in upper top rigth corner

Affected Area

  • Connection dialog (SQL Server | Azure browse/Fabric browse)
  • Query editor
  • Query results panel
  • Object Explorer
  • GitHub Copilot integration
  • Preview/Edit data
  • Table Designer
  • Schema Designer
  • Schema Compare
  • Local SQL Server Container provisioning
  • SQL database in Fabric provisioning
  • DACPAC/BACPAC export/import
  • SQL Database projects
  • Query Plan Visualizer
  • Other (please describe below)

If you selected "Other", please describe the affected area

Unable to execute some sql files

Environment Information

Version: 1.106.2 (user setup)
Commit: 1e3c50d64110be466c0b4a45222e81d2c9352888
Date: 2025-11-19T16:56:50.023Z
Electron: 37.7.0
ElectronBuildId: 12781156
Chromium: 138.0.7204.251
Node.js: 22.20.0
V8: 13.8.258.32-electron.0
OS: Windows_NT x64 10.0.19045

Installation
Identifier
ms-mssql.mssql
Version
1.37.0
Last Updated
5 days ago
Size
13.00MB

Confirmation

  • I have searched existing issues and couldn't find a match
  • I want to work on this issue

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