技术控

    今日:0| 主题:63445
收藏本版 (1)
最新软件应用技术尽在掌握

[其他] SQL SERVER – Fix Error Msg 35336 Working with ColumnStore Indexes

[复制链接]
流念你眉间 发表于 2016-10-5 16:02:12
131 1
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

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:
  1. CREATE NONCLUSTERED COLUMNSTORE INDEX
  2. t_non_clust_colstor_cci on t_non_clust_colstor (acc_description, acc_type)
  3. 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 )
天涯行 发表于 2016-10-6 19:51:13
楼下是射手
回复 支持 反对

使用道具 举报

我要投稿

推荐阅读


回页顶回复上一篇下一篇回列表
手机版/c.CoLaBug.com ( 粤ICP备05003221号 | 粤公网安备 44010402000842号 )

© 2001-2017 Comsenz Inc.

返回顶部 返回列表