STEP 1 : CREATE FILE GROUPS
- Right click on Database > Properties > Go to Filegroups Tab
- Add Following file groups Containers
- Click button ‘Add Filegroup’
- Click Ok to close this window
STEP 2 : CREATE FILES UNDER ABOVE FILE GROUPS
- Right click on Database > Properties > Go to Files Tab
- Click Add buttons to add files in respective file groups
STEP 3 : CREATE PARTITION FUNCTIONS
- Right click the Table > Storage > Partition
- Select the column by which we are going to partition in our table - in our case it is TransactionDate
- Click Next
- Specify Partition function
- Specify Partition Schema
- Map Partition Range for Data
- After specify range of each 3 drive click button Estimate storage to fill Counts
- Click Next Button
- Specify Script Type
- Click Next button
- Run Script and Finalize
- Click finish button to create Partitions.
Cross check partition in respective files
Cross check partition in table by running query on respective table
- By Running query
SELECT
o.name objectName,
i.name as indexname,
partition_id,
partition_number, [rows]
from sys.partitions p
INNER JOIN sys.objects o on o.object_id = p.object_id
INNER JOIN sys.indexes i on i.object_id=p.object_id and p.index_id=i.index_id
WHERE o.name like '%TransactionHistoryArchive%'
- End Result