sqldef / sqldef

Idempotent schema management for MySQL, PostgreSQL, and more

Home Page:https://sqldef.github.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

mssqldef: View definitions are disappeard if views are defined with header comment

odz opened this issue · comments

Platform

  • OS: Linux
  • RDBMS: SQL Server
  • Version: 016.7

Current Schema

-- users table
CREATE TABLE [users] (
  id INTEGER,
  name NVARCHAR(256),
  CONSTRAINT users_pk PRIMARY KEY CLUSTERED (id)
)
GO

-- DUAL table
CREATE VIEW DUAL AS SELECT 'X' AS X
GO

Current output (--export)

CREATE TABLE dbo.users (
    [id] int NOT NULL,
    [name] nvarchar(256),
    CONSTRAINT [users_pk] PRIMARY KEY CLUSTERED ([id]) WITH ( PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, STATISTICS_NORECOMPUTE = OFF, STATISTICS_INCREMENTAL = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON )
);
GO

Expected output

CREATE TABLE [users] (
  id INTEGER,
  name NVARCHAR(256),
  CONSTRAINT users_pk PRIMARY KEY CLUSTERED (id)
)
GO

CREATE VIEW DUAL AS SELECT 'X' AS X
GO