title: Insert into table that uses Clustered Columnstore index
body: <p>I want to insert into a table that uses clustered columnstore index.
  My logic is the following. First i am checking if the table has clustered columnstore index and then drop the index, insert the new data and finally create again the clustered columnstore index.</p>
  
  <p>Here is my sample code.</p>
  
  <pre><code>declare @sql as nvarchar(max)
  if exists (select i.name as indexname, 
         t.name as tablename
  from   sys.indexes i
    join sys.tables t on i.object_id = t.object_id
  where  i.type in (5, 6) and t.name = 'cci_table')
  begin
          set @sql = '
                      DROP CLUSTERED COLUMNSTORE INDEX cci ON dbo.cci_table'
          print @sql
  
          /** insert data to cci_table **/
  
          set @sql = '
                      CREATE CLUSTERED COLUMNSTORE INDEX cci ON dbo.cci_table'  
          print @sql
  end
  else
  begin
          set @sql = '
                      CREATE CLUSTERED COLUMNSTORE INDEX cci ON dbo.cci_table'  
          print @sql
  end
  </code></pre>
  
  <p>Is it a good approach do it like this?
  Is there a different way to insert data in clustered columnstored index table, or do i have to drop current index and then create index again?</p>