Solved

Restoring Split DB files to one single file

Posted on 2012-04-12
3
359 Views
Last Modified: 2012-04-17
I have a situation where someone added files to SQL server and created table partitions to use those files.  

My big question is, because we're moving the database to a non-enterprise level server, can this be reversed?  Can I un-partition the tables and bring the database back to a single mdf and ldf?  

Thanks in Advance!!!
0
Comment
Question by:naisnet
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 17

Assisted Solution

by:Barry Cunney
Barry Cunney earned 250 total points
ID: 37837949
I have not done this before but I am thinking that partition switching may be an option.
You could swicth each partion in turn out of the partitioned table to a non partitioned table

ALTER TABLE dbo.f_sales SWITCH PARTITION 1 TO dbo.sales_new
ALTER TABLE dbo.f_sales SWITCH PARTITION 2 TO dbo.sales_new
....
.....
0
 
LVL 2

Accepted Solution

by:
naisnet earned 0 total points
ID: 37838197
1. DROP INDEX CIDX_X on X /* drop the clustered */
2. CREATE CLUSTERED INDEX CIDX_X1 ON X(col1) ON [PRIMARY]

/* Create another clustered index on the table to free it from the partitioning scheme; Here, the "ON [primary]" part is key to removing the partition scheme from the table ! */

3. DROP PARTITION SCHEME PS1
4. DROP PARTITION FUNCTION PF1
5. DROP INDEX CIDX_X1 ON X

/* drop the dummy clustered index you created, as it was only created to free the table from the partitioning scheme */
0
 
LVL 2

Author Closing Comment

by:naisnet
ID: 37854932
Found the solution while searching
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
This article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question