Azure SQL DB?

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?
LVL 1
Jess31Asked:
Who is Participating?
 
Vitor MontalvãoConnect With a Mentor MSSQL Senior EngineerCommented:
Use the REBUILD command:
ALTER INDEX ALL ON TableName
REBUILD

Open in new window

0
 
Vitor MontalvãoMSSQL Senior EngineerCommented:
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
 
Jess31Author Commented:
Is there away for me to have Azure physically remove the deleted items similar to what it does on a Restore?
0
All Courses

From novice to tech pro — start learning today.