Search This Blog

Wednesday, October 29, 2008

Create Partition Function and Partition Scheme

Below partition functions and scheme created to use data as argument or base. First of all you need to add a file group in your current database and then you have to create this partition function and scheme on the base of partition function.

--- * Add Filegroup in the current Database
ALTER DATABASE TEST ADD FILEGROUP FG1

-- * Create Partition Function
CREATE PARTITION FUNCTION PFDATE (DATETIME)
AS RANGE LEFT FOR VALUES ('2008-10-25')

-- * Create Partition Scheme
CREATE PARTITION SCHEME PSDATE AS
PARTITION PFDATE TO (FG1,FG1)

No comments: