Problem with partitioning table

  • Hello

    I'm trying to partiton a table that contains historical data, I created filegroups and attached files to each one.

    The filegroups and files are

    EOD_2010_FG EOD_2010

    EOD_Jan EOD_Jan

    ....

    The idea is to store all data before 1 january 2011 in the file for 2011, and then all following partinioned per month, with the idea of archiving the data of this year by merging the partitions at the end of this year

    I created the following partitioning function

    CREATE PARTITION FUNCTION [pfn_historyKeeping](date) AS RANGE RIGHT FOR VALUES (N'2011-01-01', N'2011-02-01', N'2011-03-01', N'2011-04-01', N'2011-05-01', N'2011-06-01', N'2011-07-01', N'2011-08-01', N'2011-09-01', N'2011-10-01', N'2011-11-01', N'2011-12-01', N'2012-01-01')

    And the following partioning scheme

    CREATE PARTITION SCHEME [psc_historyKeeping] AS PARTITION [pfn_historyKeeping] TO ([EOD_2010_FG], [EOD_Jan], [EOD_Feb], [EOD_Mar], [EOD_Apr], [EOD_May], [EOD_Jun], [EOD_Jul], [EOD_Aug], [EOD_Sep], [EOD_Oct], [EOD_Nov], [EOD_Dec], [PRIMARY])

    However when I try to execute the statement I get the following error

    Msg 208, Level 16, State 58, Line 4

    Invalid object name 'EOD_2010_FG'.

    Anyone who can help me explain what I'm doing wrong

  • This was removed by the editor as SPAM

  • I created them using the properties windows of the database

  • firstly, you must make sure that you have already created the error filegroup

    can you take a Screenshot of database Properties?

  • Files

    FileGroups

  • I cannot find anything wrong with you sql-code

    the one thing you can do is to re-create the filegroup EOD_2010_FG

    You can use the sql-code below to delete the filegroup EOD_2010_FG

    DBCC SHRINKFILE ('EOD_2010.ndf', EMPTYFILE)

    alter database DATABASENAME remove file [EOD_2010]

    alter database DATABASENAME remove filegroup [EOD_2010_FG]

Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply