views:

50

answers:

2

We were doing load testing the other day and during it, one of our developers used the Performance Tuning Advisor and applied all the recommendations. Our site could then handle a lot more load and we were happy. However he did not save the recommendations and the load test was not done on our production server. I can't figure out how to apply the recommendations to our other environments. Is there a way to do this or at very least export the indexes that it created?

Thanks, ~james

A: 

If you know what indexes were created you can right click on each index in SSMS and choose the Script Index --> As Create option. This will generate a SQL script -- running this script on another database will recreate that index in that db.

If you don't know which indexes were created, but you do remember which tables were touched you can script the tables. This will generate an even bigger script, and you can only run that parts that you need.

Sean Reilly
+3  A: 

Redgate have a product called SQL Compare that will let you do a diff between two databases and generate a script to synchronize them.

I've just started using it. It's one of those tools that you wish you'd had years ago.

geofftnz
excellent stuff - will save your bacon over and over again! :-)
marc_s
I've saved so much bacon in the last couple of weeks I need to start looking at an investment plan.
geofftnz

related questions