September 8, 2022 at 4:57 pm
I have a table that I want to partition by postcode (example values are: 7420_FMIL, ND8_1ZE, C7_4JM) where each rows for a certain postcode would get inserted into its own respective filegroup (Rows for Postcode 7420_FMIL would be in Filegroup FG_7420_FMIL for example) .
What would the partition function look like?
CREATE PARTITION FUNCTION PF_Postcode(varchar(100))
AS RANGE LEFT FOR VALUES
(
7420_FMIL,
ND8_1ZE,
C7_4JM
)
Would that work? Any help would be much appreciated
September 8, 2022 at 8:28 pm
Before going down the path of partitioning - what are you expecting to achieve by doing so? What is the purpose of partitioning - and more to the point, why are you wanting to separate the data into separate filegroups and files?
You don't have to use separate filegroups for partitioning - and there are some benefits to having all partitions in the same filegroup. If you setup multiple filegroups where the files are all on the same drive then there really isn't any benefit to multiple filegroups.
Jeffrey Williams
“We are all faced with a series of great opportunities brilliantly disguised as impossible situations.”
― Charles R. Swindoll
How to post questions to get better answers faster
Managing Transaction Logs
September 8, 2022 at 11:35 pm
I think it would be as below. You must put the partition values in alpha order.
CREATE PARTITION FUNCTION PF_Postcode(varchar(100))
AS RANGE LEFT FOR VALUES
(
'7420_FMIL',
'C7_4JM',
'ND8_1ZE'
)
SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".
September 29, 2022 at 9:41 am
This was removed by the editor as SPAM
September 29, 2022 at 1:20 pm
Much appreciated so a phenomenal plan, your thought worked for me.
I smell spam cooking.
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply