microsoft / SqlScriptDOM

ScriptDOM/SqlDOM is a .NET library for parsing T-SQL statements and interacting with its abstract syntax tree
MIT License
135 stars 18 forks source link

Support for "WITH (DATA_COMPRESSION = COLUMNSTORE | COLUMNSTORE_ARCHIVE)" for inline index #87

Open zacateras opened 3 months ago

zacateras commented 3 months ago

Steps to Reproduce:

using Microsoft.SqlServer.TransactSql.ScriptDom;

var script = @"
  CREATE TABLE [dbo].[Sample](
  [ID] [int] NULL,
  [Code] [varchar](100) NULL,
  INDEX [IDX] CLUSTERED COLUMNSTORE WITH (DATA_COMPRESSION = COLUMNSTORE)
)
";

var parser = new TSql150Parser(false);
var fragment = parser.Parse(new StringReader(script), out var parseErrors);

Console.WriteLine(parseErrors[0].Message);

// Outputs:
// "Option 'DATA_COMPRESSION' is not a valid index option in 'CREATE TABLE (inline index)' statement."