Click here to Skip to main content
15,888,610 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I'm using SQL server express edition in my official laptop ,I got a database of 35 GB from my team. when i try to restore in my laptop,It is not allow to restore more than 10 GB because it a express edition.

So, I installed SQL server standard edition trial version in my another laptop,then i restored there.

what i want to do is,i have to shrink the database size less than 10 GB ,then i have to restore in my official laptop

What I have tried:

I have tried to shrink my database ,the file sizes are below
.mdf : 19 GB<br />
.ldf : 15 GB


I removed some unnecessary tables,then i shrink-ed , It took around 3 hours to shrink the database.
After shrinking ,
.mdf 10.6 GB,<br />
.ldf 19 GB <br />


Again i tried to remove few tables ,truncated some large table data's and all.

but shrinking is not happening the .mdf size still in 10.6 GB. but no matter of removing log files,i want to shrink the data file mainly.

How can i do this?
Posted
Updated 24-Mar-16 23:46pm
v2

1 solution

Probably, you can't. If they original file is 35GB, then it's probably a database that's pretty full of data - and if the data occupies a lot of space, you can't shrink the file significantly without removing some of the data!

About the only way you are going to be able to do that without discarding data is to create two (or more) new databases and put half the data in one, and half in the other to get two smaller files. It complicates your application to use them, but it should let you get the files small enough to fit in SQL Express.
Or buy the full version of SQL Server! :laugh:
 
Share this answer
 
Comments
King Fisher 25-Mar-16 6:20am    
but it is showing the available free space is 6 GB ,after i truncate some large table data. then why shrinking is not happening? :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900