Solved

Azure SQL DB?

Posted on 2016-11-30
3
40 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 46

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 46

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Monitoring systems evolution, cloud technology benefits and cloud cost calculators business utility.
Exchange server is not supported in any cloud-hosted platform (other than Azure with Azure Premium Storage).
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.
Viewers will learn how the fundamental information of how to create a table.

911 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now