Delete Partition

  • I have one partition on the table, but now i want to delete that partition.

    how could i do this.

  • Hello,

    To remove partitioning form a table you need to drop the relevant constraint. If you want also to remove any dependency on the Partition Scheme (so you can drop that as well) then include the "With Move" Clause e.g.

    Alter Table dbo.Test Drop Constraint [idx_Test_Id] With (Move To "Default")

    Regards,

    John Marsh

    www.sql.lu
    SQL Server Luxembourg User Group

  • Some day somebody is going to tell me the truth about why SQL Server partitioning is such a nightmare.

    Don't understand why. Other RDBMS developed the technology before and made it so simple my little sister can do either a "truncate partition table_name:partition_name" or "drop partition table_name:partition_name" in less time that it takes to write this note.

    Amazing.

    _____________________________________
    Pablo (Paul) Berzukov

    Author of Understanding Database Administration available at Amazon and other bookstores.

    Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.
  • Other RDBMS developed the technology before and made it so simple my little sister can do either a "truncate partition table_name:partition_name" or "drop partition table_name:partition_name" in less time that it takes to write this note.

    Because Oracle has a patent, MS cannot use that technique.

    See "Method and mechanism for database partitioning" at http://www.freepatentsonline.com/6931390.html

    The patent filing was 02/27/2001, so it will be until 2015 before anyone else can use the technique.

    Wikipedia has a number of articles about Patent Law for the US, Europe and Japan.

    SQL = Scarcely Qualifies as a Language

  • Also the reason why Microsoft has improved the interface for managing a partition in SQL 2008's Management Studio.

    Totally agree though. The T-SQL implementation for partition management is klunky. It works, sure, but its not very "pretty". So your choices are from a programming perspective are to try to manage it with T-SQL and bizzare metadata views and functions, or use the object layer with SMO.

    And you better bet your bottom dollar if it were any simpler, Mr. Ellison and his cronies would salivate at the opportunity. Of course if the roles were reversed, I'm sure the opposite would be absolutely true.

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

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