SSMS - Consistency in Scripting Options Across Team

  • Hi,

    We use SSMS' "generate scripts" feature to script out all DB objects for source control.  We have our scripting options dialed in the way that we like them under Tools -> Options -> SQL Server Object Explorer -> Scripting. Historically it had been a small handful of people that go through the process of scripting objects and so it's fairly easy to ensure we're using the same options configuration.

    However, our team has recently grown quite a bit and now we're wrestling with folks having different scripting options, and this is creating quite a bit of noise in source control. I was hoping to be able to share, or export/import, an SSMS config file that contains the settings in Tools -> Options -> SQL Server Object Explorer -> Scripting.  However, "Import and Export Settings" doesn't seem to save the scripting options.

    Is there a way to export/import/share scripting options so that we ensure consistency in scripting across our whole team? Or is it just a manual effort that each team member needs to go through to set those settings? Thanks for your help.

  • you can't - and a better option would likely be for  you to start using VS database projects and keep all your objects on it - easy to integrate with source control as well.

    main reason for not using scripting is that you may miss a setting - I've seen too many people generating scripts and forgetting data compression or indexes - and then db where those scripts are applied is messed up.

     

    an alternative is to do the script generation through powershell with SMO - either home made or using dbatools.io (https://docs.dbatools.io/Export-DbaScript)

  • Thanks for the suggestions.  We do have a homemade PowerShell script as well that mimics our desired settings, so we could use that rather than scripting from SSMS.  I'll also take another look at database projects and see if that might be the better solution.

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply