Solved

Azure SQL DB?

Posted on 2016-11-30
3
43 Views
Last Modified: 2016-11-30
I have a database in Azure SQL. It is 50 GB in size. I made changes to many of its columns, changing nvar to var, deleting rows, but the size remains about the same. I Exported it to a backpac and imported the backpac to a local SQL Server 2016 and the local db shows its size about 34 GB. I am thinking that Azure is not compacting the db after these changes. Is there something I could/should run for Azure to compact the db?
0
Comment
Question by:Jess31
  • 2
3 Comments
 
LVL 47

Expert Comment

by:Vitor Montalvão
ID: 41907354
Isn't about compacting. Things in SQL Server aren't really deleted but marked as delete. When you run a reindex the data pages will be organized and all columns marked as deleted will be physically removed.
That's also the behavior for a Restore command.
1
 

Author Comment

by:Jess31
ID: 41907517
Is there away for me to have Azure physically remove the deleted items similar to what it does on a Restore?
0
 
LVL 47

Accepted Solution

by:
Vitor Montalvão earned 500 total points
ID: 41907521
Use the REBUILD command:
ALTER INDEX ALL ON TableName
REBUILD

Open in new window

0

Featured Post

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

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

Suggested Solutions

The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
Most of the applications these days are on Cloud. Cloud is ubiquitous with many service providers in the market. Since it has many benefits such as cost reduction, software updates, remote access, disaster recovery and much more.
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties
Viewers will learn how the fundamental information of how to create a table.

777 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