× Heads up!

Aqua Data Studio / nhilam

Follow
IDE for Relational Databases
×
SachinPrakash reported 2013-01-24T16:32:38Z  · last modified 2013-02-04T18:28:38Z

SQL Server 2008 - Clustered indexes can’t have include columns


customer request
Dev
Jenny Nishimura
JennyNishimura
QA
Priority Minor
Complexity Unknown
Component Tools - Compare - Schema
Version 12.0

Scenario: On table x, create a partition and create a clustered index.

When doing a schema compare, the script generated for a clustered index uses the INCLUDE keyword and is including columns from the partition. This is invalid. Clustered indexes cannot INCLUDE columns.

Expected result: Clustered indexes should not specify the INCLUDE columns syntax.

To reproduce the problem:

1. Create a partition and a table as follows.
     CREATE PARTITION FUNCTION [myRangePF10] (int) AS RANGE LEFT FOR VALUES (1,100,1000)
     GO
     CREATE PARTITION SCHEME [myRangePS10] AS PARTITION [myRangePF10] TO ([test1fg],[test1fg],[test1fg],[test4fg])
     GO
     CREATE TABLE [dbo].[Part_Table_10]  (
         [col1]    int NOT NULL,
         [col2]    int NOT NULL,
         [col3]    int NOT NULL
     )
     GO

2. Create a clustered index as follows.  Note that the index column must be different than the partition column.
     CREATE CLUSTERED INDEX [IX_TEST10]
         ON [dbo].[Part_Table_10]([col3])
         ON [myRangePS10] (col2)
     GO

3. Script the index using the "CREATE (Full)" option.
     IF NOT EXISTS (select 'exists' from sys.partition_functions where name = 'myRangePF10')
     CREATE PARTITION FUNCTION [myRangePF10] (int) AS RANGE LEFT FOR VALUES (1,100,1000)
     GO
     IF NOT EXISTS (select 'exists' from sys.partition_schemes where name = 'myRangePS10')
     CREATE PARTITION SCHEME [myRangePS10] AS PARTITION [myRangePF10] TO ([test1fg],[test1fg],[test1fg],[test4fg])
     GO
     CREATE CLUSTERED INDEX [IX_TEST10]
         ON [dbo].[Part_Table_10]([col3])
         INCLUDE ([col2])
         ON [myRangePS10] (col2)
     GO

Issue #8246

Closed
Fixed
Resolved 2013-01-24T19:11:32Z
 
 
Completion
No due date
Fixed Build 31076
No time estimate

About AquaClusters Privacy Policy Support Version - 19.0.2-4 AquaFold, Inc Copyright © 2007-2017