I suspect many people assume this is the case, but a customer recently asked if SQL Compare handles indexes. It does, and this post shows the basics of index comparisons with no filters.
This is a part of a series of posts on SQL Compare on my blog. You can read other posts I’ve written by clicking the link.
The Setup
I have two databases that are completely synced from a schema perspective.
I’ll now create an index in Compare1. This is a simple index on a single table. I use this code:
CREATE INDEX IDX_mychar ON dbo.MyTable (Mychar)
Once I refresh the compare, I see this. Note that I’ve selected the table that has a difference and it shows the new index. This bottom left shows the scripted version of the code I ran above.
If I create the deployment script, I see the index in it, as shown here:
By default, SQL Compare includes almost all objects and that includes indexes. There are options to change the behavior with indexes, and I’ll cover those in future posts. You can also set a filter that might exclude indexes (or include those), but those are also future posts.
SQL Compare is a fantastic product for simplifying work and it does so much more than this. Give it a try if you own it or download an evaluation today.