text: ﻿IF DB_ID('DemoDB') IS NULL
  	CREATE DATABASE DemoDB
  GO
  
  USE DemoDB
  GO
  
  IF OBJECT_ID('ORDERS_CI','U') IS NOT NULL
      DROP TABLE ORDERS_CI
  GO
  
  
  CREATE TABLE [dbo].[ORDERS_CI](
  	[O_ORDERKEY] [int] NOT NULL PRIMARY KEY NONCLUSTERED,
  	[O_CUSTKEY] [int] NOT NULL,
  	[O_ORDERSTATUS] [char](1) NOT NULL,
  	[O_TOTALPRICE] [decimal](15, 2) NOT NULL,
  	[O_ORDERDATE] [date] NOT NULL,
  	[O_ORDERPRIORITY] [nchar](15) NOT NULL,
  	[O_CLERK] [char](15) NOT NULL,
  	[O_SHIPPRIORITY] [int] NOT NULL,
  	[O_COMMENT] [varchar](79) NOT NULL,
  	INDEX CCIX_ORDERS_CI CLUSTERED COLUMNSTORE 
  )
  /*
  初期データのロード
  DBCC TRACEON (610, -1)
  FOR /L %i IN (1,1,5) DO start bcp dbo.ORDERS_CI in E:\dbgen\orders.tbl.%i -S localhost -d demodb -T -c -t "|" -r 0x0A
  */
  
  /*
  2014 の列ストアインデックスの作成方法
  CREATE TABLE [dbo].[ORDERS_CI](
  	[O_ORDERKEY] [int] NOT NULL,
  	[O_CUSTKEY] [int] NOT NULL,
  	[O_ORDERSTATUS] [char](1) NOT NULL,
  	[O_TOTALPRICE] [decimal](15, 2) NOT NULL,
  	[O_ORDERDATE] [date] NOT NULL,
  	[O_ORDERPRIORITY] [nchar](15) NOT NULL,
  	[O_CLERK] [char](15) NOT NULL,
  	[O_SHIPPRIORITY] [int] NOT NULL,
  	[O_COMMENT] [varchar](79) NOT NULL
  )
  CREATE CLUSTERED COLUMNSTORE INDEX CIX_ORDERS_CI ON ORDERS_CI
  */
  