Quantcast
Channel: ฟอรัม Getting started with SQL Server
Viewing all articles
Browse latest Browse all 8428

How to do partition on a non clustered index column?

$
0
0

I have table ORDERS .Where there are Million rows in it .I need to add Pationed Index on Order to store data in one of two files based on the new IsLocked field.But when i checked table there is a Non clustered index on ISLocked Column.IsLocked field consists of 1 and O's.Can you guys suggest me best approach.

CREATETABLE[Orders]([OrderID][int]IDENTITY(1,1)NOTNULL,[OrderNo][varchar](50)NULL,[AccountNo][varchar](20)NULL,[CompleteDate] date null,[LastUpdateDate]) date null,[AccountID] int NULL,[IsWarranty][bit]NULL,[IsEmailAddressFound][bit]NULL,[IsLocked][bit]NOTNULL,[LinkOrderID][int]NULL)

But already there is a

CREATENONCLUSTEREDINDEX[IX_IsLockedAccountID]ON[coe].[Orders]([IsLocked]ASC,[AccountID]ASC)
INCLUDE ([OrderNo],[CompleteDate],[LastUpdateDate])WITH(PAD_INDEX =OFF, STATISTICS_NORECOMPUTE =OFF, SORT_IN_TEMPDB =OFF, DROP_EXISTING =OFF, ONLINE =OFF, ALLOW_ROW_LOCKS =ON, ALLOW_PAGE_LOCKS =ON)ON[PRIMARY]
GO
Orders    IX_IsLockedAccountID    NONCLUSTERED7205759455671091211146462

Can you giys please help me how to do partioning as i am completely new to Table partioning .


Viewing all articles
Browse latest Browse all 8428

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>