How to rebuild an Index in SQL Azure using ALTER INDEX

Indexes help with database performance. If you do not have an index on a table, SQL Azure has no choice but to use a Table Scan. If you do not know, Table Scan is slowest method of retrieving data from SQL. You can either have a clustered or a non-clustered index in SQL azure. As new data is inserted in a table and existing data gets updated, table indexes can become scattered or fragmented. This typically happens when the logical ordering of a data page does not match the physical ordering. In order to defrag an index, you can either rebuild or reorganize an index. If there is heavy fragmentation, rebuilding an index is a better choice.

This method is what we are going to use in today’s topic on SQL Azure.

The SQL Azure Tutorials and SQL scripts told me exactly what I needed to know and helped me get the job done. Did not spend days online reading about it, followed along and just did it! Awesome training!!