SQL Compare Auto Create Statistics

Hi,

I'm writing a script to change the collation of everything in a database. Part of this involved recreating statisics. My issue is that if I recreate ones that were auto created, they are created as non-auto created. SQL Compare doesn't show auto created statistics (no idea why) which means my comparison shows loads of apparently new statics.

Is there any way to get SQL Compare to match identical stats based on name & columns regardless of the Auto Created flag?

Answers

  • Eddie DEddie D Posts: 1,806 Rose Gold 5
    Hi BobbyOwen,
    Thank you for your forum post.

    To be honest, I do not think that SQL Compare will help you in this situation.

    SQL Compare does have an Ignore Option to Ignore statistics.  If using the GUI ->Edit Project ->Options Tab and enable the Ignore Statistics option.  Or if using the command line option: IgnoreStatistics (Alias: ist).
    Ignores statistics when comparing and deploying databases. In the case of a scripts folder target, SQL Compare will deploy objects without statistics even if the source or target uses statistics.

    As you have discovered,  system created statistics don't show up in the comparison.  Therefore there is no option that you can set to match identical stats based on name & columns regardless of the Auto Created flag.

    If this is an option you would like to see be included in a future versions of SQL Compare, I recommend that you post a feature suggestion in SQL Compare's User Voice Forum.

    Many Thanks
    Eddie
    Eddie Davis
    Senior Product Support Engineer
    Redgate Software Ltd
    Email: support@red-gate.com
Sign In or Register to comment.