未加星标

SQL SERVER Fix Error Msg 35336 Working with ColumnStore Indexes

字体大小 | |
[数据库(mssql) 所属分类 数据库(mssql) | 发布者 店小二05 | 时间 2016 | 作者 红领巾 ] 0人收藏点击收藏

Since my consulting have started around performance tuning, I am able to see a number of customers who want to start using the new capabilities of SQL Server for their existing application as they plan to do an upgrade of their infrastructure. In one of engagement with a bank, who was upgrading their SQL Server 2012 to SQL Server 2016, they were interested in knowing how some of the new InMemory or even usage of ColumnStore Indexes can be used. It was an interesting conversation that started which I am using as a blog here.

I confronted them with the question on their inability to use a Non-Clustered ColumnStore index even in SQL Server 2012? They said they had evaluated and then saw that table was rendered read only once the Index was created. It made complete sense and as I planned for their session on a SQL Server 2016 developer edition, I said now the non-clustered columnstore indexes were actually now updateable.

To start playing with the demo, I just went about creating a table and then a non-clustered Columnstore index based on my memory of the syntax. It is sometimes customary for me to do the same to write code randomly in front of the customer. To my surprise, I got the following error:

Msg 35336, Level 15, State 1, Line 1
The statement failed because specifying a key list is missing when creating an index.
Create the index with specifying key list.
SQL SERVER   Fix Error Msg 35336 Working with ColumnStore Indexes

As you can see, the first reaction seeing the “Red” error message was that I was doing something terribly wrong. It was a face-palm reaction for me. But I took a deep breath and saw that the error message it had what I was missing. I changed the same code to the column key values as shown below, it just worked fine:

CREATE NONCLUSTERED COLUMNSTORE INDEX t_non_clust_colstor_cci on t_non_clust_colstor (acc_description, acc_type) WITH (DATA_COMPRESSION= COLUMNSTORE);

I couldn’t get over to why I did that code and on my way to the airport, I was trying to figure out the reason. Then it suddenly struck me that the key values are not applicable for Clustered ColumnStore Indexes and that was in my mind. Now I felt relaxed as I boarded the flight.

Thanks to SQL Server for guiding me with a self-explanatory error message. I am sure you have in the past seen a number of error messages for debugging made easier. Do let me know if you ever got to such hero moments and found yourself in a soup? Do share via comments.

Reference: Pinal Dave ( http://blog.sqlauthority.com )

本文数据库(mssql)相关术语:熊片数据库 mssql数据库 oracle数据库 pubmed数据库 access数据库 万方数据库

主题: SQLSQL Server
分页:12
转载请注明
本文标题:SQL SERVER Fix Error Msg 35336 Working with ColumnStore Indexes
本站链接:http://www.codesec.net/view/480070.html
分享请点击:


1.凡CodeSecTeam转载的文章,均出自其它媒体或其他官网介绍,目的在于传递更多的信息,并不代表本站赞同其观点和其真实性负责;
2.转载的文章仅代表原创作者观点,与本站无关。其原创性以及文中陈述文字和内容未经本站证实,本站对该文以及其中全部或者部分内容、文字的真实性、完整性、及时性,不作出任何保证或承若;
3.如本站转载稿涉及版权等问题,请作者及时联系本站,我们会及时处理。
登录后可拥有收藏文章、关注作者等权限...
技术大类 技术大类 | 数据库(mssql) | 评论(0) | 阅读(52)