I tested the process quoted by you. It worked fine but the problem is now I can also insert data into read only files.
select name,is_read_only from sys.filegroups
PRIMARY 0
FGDayRange011
FGDayRange021
FGDayRange031
FGDayRange041
FGDayRange050
FGDayRange060
Before Inserts:
total records Partitionnumber
450 3
550 6
50 1
450 4
500 5
450 2
After Inserts:
Total RecordsPartition Number
500 3
600 6
50 1
500 4
550 5
500 2
Currently the clustered primary index is created on file group FGDayRange06. I am using the below query to get the total count---
SELECT COUNT(*) AS [Total Records], $Partition.pfFiveDayRange(businessDate) AS [Partition Number]
FROM MSSQLTIPS_Partitions
GROUP BY $Partition.pfFiveDayRange(businessDate);
I am completely bowled by the above scenario. What I am missing? Any suggestions?