schemazen
schemazen copied to clipboard
CREATE CLUSTERED COLUMNSTORE INDEX - Not working
Hi, When extracting and creating CCI index the structure is different and it doesn't create the table or index. Example: Source: CREATE CLUSTERED COLUMNSTORE INDEX [CCI_SCHEMAZEN_ROX] ON [dbo].[SchemaZen] Trying to create a normal index: CREATE NONCLUSTERED INDEX [CCI_SCHEMAZEN_ROX] ON [dbo].[SchemaZen] () INCLUDE (columns....) Error giving: Incorrect syntax near ')'.
Thank you in Advance, Mário Mineiro
Thanks for reporting. I think this is fixed, but I'm not able to test as Column Store indexes are only supported in Enterprise Edition. Please test using the latest version and let me know if this is fixed. Thanks.
Hi @sethreno , Thank you for the fast fix, but still not working, I tested only the .exe version. The structured output didn't change from the previous version to this version.
The fix must:
- "CREATE NONCLUSTERED INDEX" should be "CREATE CLUSTERED COLUMNSTORE INDEX"
- remove the ()
- remove the include/columns (CCI don't have include)
I'm available and please let me know if you need help on this.
Thank you in advance, such a great script:+1: excellent new features loved it
This should be fixed in the latest version https://github.com/sethreno/schemazen/releases/tag/1.3.51
Again, I'm not able to test so please verify and let me know if it works. Thanks!
hi @sethreno still not working
I'm using msdn as a reference and I don't see anything wrong. Can you give more detail on what's not working? If you could post the script produced by the latest schemazen exe compared to a working script that would be great.
The issue is in the syntax. The program is creating the following : CREATE CLUSTERED COLUMNSTORE INDEX [IndexName] ON [schema].[table] () INCLUDE (Columns)
but it needs to be
CREATE CLUSTERED COLUMNSTORE INDEX [IndexName] ON [schema].[TableName]
The clustered columnstore index includes all columns as this is how it is designed.