Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 To create partitions within a Table

Author  Topic 

nicoolz05
Starting Member

2 Posts

Posted - 2013-10-30 : 10:04:52
I have a table in sql server 2008 enterprise editions with partitions on 3 month basis. I need to take back up of this table. If i used the script:

select * into <backup_table_name>
from <table_name>
where <condition>;

Another copy of table will be created. But will it be containing same data as in previous table with partitions ?

James K
Master Smack Fu Yak Hacker

3873 Posts

Posted - 2013-10-30 : 10:17:12
All the data from all the partitions will be inserted into the new table (subject to your where conditions). But the new table will be created in the default partition. SELECT INTO construct cannot be used to create a partitioned table.
Go to Top of Page

nicoolz05
Starting Member

2 Posts

Posted - 2013-10-31 : 11:32:59
Hi James,

Thanks for your Reply. Normally when we install MS CRM , it creates partitions for AuditBase table. Normally it has some logs. These Logs are displayed in MSCRM GUI on 3 month partitioned basis.These logs can be deleted directly from CRM GUI, which will automatically clear all the contents from Database
(MSCRM 2011) only support fastdelete unlike CRM 4.0 which supports softdelete.

As it is a Prod box, prior deleting the logs directly from GUI i have to take backup.

How can i take backup ?

So that if client wants to rollback then i can show him in GUI that logs have been created again and that too as it was earlier (In partitioned format)
[url][/url][url][/url][url][/url]
Go to Top of Page

James K
Master Smack Fu Yak Hacker

3873 Posts

Posted - 2013-10-31 : 12:03:15
The pictures you posted did not come through. Regardless, if you want to take a copy of a partitioned table, and you want to have the copy also be on corresponding partitions, you have to first create the new partitioned table and then copy into that.
Go to Top of Page
   

- Advertisement -