I have partitioned (range) a very large table. I have re-created the clustered index and included the partition key in it. I also made sure it was created using the partition scheme. All well so far. Now to the non-clustered indexes which are non-unique. According to this page: http://msdn.microsoft.com/en-us/library/ms187526(v=SQL.90).aspx the partition key will be added as a non key automatically.
"When partitioning a nonunique, nonclustered index, SQL Server adds the partitioning column by default as a nonkey (included) column of the index to make sure the index is aligned with the base table."
Is this only when using the GUI? Because this does not happen for me using DDL, according to syntax below:
CREATE NONCLUSTERED INDEX [my_nc_index] ON [dbo].[my_table]
(
[ID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [pf_scheme]([year])