Multiple partition schema on a single table in SQL Server

Hi All,

i want to  create multiple partition schema on a single table.

for example - i need to create partition  base on region id and Territory Id.

Regards,

Manish

April 22nd, 2015 1:52am

Hi,

please any body can replay it is possible or not.

Regards,

Manish

Free Windows Admin Tool Kit Click here and download it now
April 22nd, 2015 2:59am

AFAIK you cant do table partitioning based on multiple columns in a straightforward way

However there are some workarounds

1. Using a lookup table

Create a lookup table with a identity field that holds the composite column value combinations ie regionId and TerritoryId in your case.

In your main table add a column for the lookup table reference id and then make the partitioning based on this new reference column.

2. Add a persisted computed column by applying HASHBYTES function over values of two fields ie regionId and TerritoryId based on which you want to partition and use this column for partitioning the table

See HASHBYTES usage here

http://visakhm.blogspot.com/2014/06/ssis-tips-implementing-scd.html


April 22nd, 2015 3:15am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics