Skip to content

Incorrect syntax: 'CREATE VIEW' must be the only statement in the batch when using OPENROWSET(BULK ('table')) #30

Description

  • MSSQL Extension Version: v1.25.0
  • VSCode Version: 1.94.0
  • OS Version: Windows 11 Enterprise 23H2

Steps to Reproduce:

  1. Paste this SQL into a .sql file in Visual Studio Code with the extension added:
CREATE OR ALTER VIEW [myschema].[myview] AS 

SELECT mytable.myid
	FROM OPENROWSET(BULK ('/blob_storage_address/**'), DATA_SOURCE = 'my_datasource', FORMAT = 'PARQUET') AS mytable
;
GO

You will get something like the below:

Image
This is valid SQL, using OPENROWSET(BULK()) for Synapse, as per this guide.

Activity

  1. kburtram commented on Oct 1, 2025

    @kburtram
    Member

    This appears to be an issue with the SQL Parser that is used for detecting syntax errors. I'll transfer to that repo for triage. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions