|
sql
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Delete & create a partitionHello All,
I am working on a hugeee table partionned in 20. Working on one partition at one time, I need to drop and re-create a partition before inserting treated data. Anyone know if I can drop then re-create a partion ? if yes, How. if no, any alternative like truncate partion maybe... Thanks !! Arnold. > Anyone know if I can drop then re-create a partion ? if yes, How. if no, To effectively truncate a partition, SWITCH the desired partition into a > any > alternative like truncate partion maybe... staging table. The staging table needs to be on the same filegroup(s) with like schema and indexes. You can then drop or truncate the staging table to permanently remove the data. -- Show quoteHope this helps. Dan Guzman SQL Server MVP "r.no" <r**@discussions.microsoft.com> wrote in message news:85E5D494-3BDE-4B68-9B52-04ED3A9B1C43@microsoft.com... > Hello All, > > I am working on a hugeee table partionned in 20. > > Working on one partition at one time, I need to drop and re-create a > partition before inserting treated data. > > Anyone know if I can drop then re-create a partion ? if yes, How. if no, > any > alternative like truncate partion maybe... > > Thanks !! > Arnold. But what do I do after doing the truncate on the staging table ? how do I go
back to main table ? i need some kind of "switch back" to original table partition ? -- Show quoteArnold "Dan Guzman" wrote: > > Anyone know if I can drop then re-create a partion ? if yes, How. if no, > > any > > alternative like truncate partion maybe... > > To effectively truncate a partition, SWITCH the desired partition into a > staging table. The staging table needs to be on the same filegroup(s) with > like schema and indexes. You can then drop or truncate the staging table to > permanently remove the data. > > -- > Hope this helps. > > Dan Guzman > SQL Server MVP > > "r.no" <r**@discussions.microsoft.com> wrote in message > news:85E5D494-3BDE-4B68-9B52-04ED3A9B1C43@microsoft.com... > > Hello All, > > > > I am working on a hugeee table partionned in 20. > > > > Working on one partition at one time, I need to drop and re-create a > > partition before inserting treated data. > > > > Anyone know if I can drop then re-create a partion ? if yes, How. if no, > > any > > alternative like truncate partion maybe... > > > > Thanks !! > > Arnold. > After the switch out, the source partition will still exist with the same
boundaries but will be empty. No need to switch anything back. -- Show quoteHope this helps. Dan Guzman SQL Server MVP "r.no" <r**@discussions.microsoft.com> wrote in message news:33DB4230-786C-4661-9905-9A23D5CE3C84@microsoft.com... > But what do I do after doing the truncate on the staging table ? how do I > go > back to main table ? i need some kind of "switch back" to original table > partition ? > > -- > Arnold > > > "Dan Guzman" wrote: > >> > Anyone know if I can drop then re-create a partion ? if yes, How. if >> > no, >> > any >> > alternative like truncate partion maybe... >> >> To effectively truncate a partition, SWITCH the desired partition into a >> staging table. The staging table needs to be on the same filegroup(s) >> with >> like schema and indexes. You can then drop or truncate the staging table >> to >> permanently remove the data. >> >> -- >> Hope this helps. >> >> Dan Guzman >> SQL Server MVP >> >> "r.no" <r**@discussions.microsoft.com> wrote in message >> news:85E5D494-3BDE-4B68-9B52-04ED3A9B1C43@microsoft.com... >> > Hello All, >> > >> > I am working on a hugeee table partionned in 20. >> > >> > Working on one partition at one time, I need to drop and re-create a >> > partition before inserting treated data. >> > >> > Anyone know if I can drop then re-create a partion ? if yes, How. if >> > no, >> > any >> > alternative like truncate partion maybe... >> > >> > Thanks !! >> > Arnold. >> |
|||||||||||||||||||||||