Solved

Azure SQL DB?

Posted on 2016-11-30
3
12 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 45

Expert Comment

by:Vitor Montalvão
Comment Utility
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
Comment Utility
Is there away for me to have Azure physically remove the deleted items similar to what it does on a Restore?
0
 
LVL 45

Accepted Solution

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

Open in new window

0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Dynamics crm 2011 8 43
Shop sales Actual vs Forecast 2 24
Numeric sequence in SQL 14 36
Trouble connecting to SqlServer database 4 29
Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

763 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

11 Experts available now in Live!

Get 1:1 Help Now