SQL Server Edition aware SSDT deployment scripts

Another day another deployment contributor for the project: https://github.com/DacFxDeploymentContributors/Contributors.

This one came about because I was talking to Peter Schott (b|t) over at the deployment contributor gitter room and he has dacpac he wants to deploy to different editions of sql server and enable different options when deploying to enterprise edition.

One of the things I found out is that from a contributor, although you have the source and destination models you do not have access to any information about the server other than the version. To get around this you can either pass in an arg to say which edition the compare is running against or if you leave that off then the create index statement is duplicated and wrapped on an check against @@version to determine the edition which is more t-sql than I would like but should work.

One other thing I have realised is that I have by default used the generators for the 120 version of SQL but in the contributors I could get the version from the context and use the correct one - maybe a task for the next one.

Finally I have changed the message box at the beginning to a Debuger.Launch which works much better - thanks to Ken (blog)

After a random twitter conversation I have a great new contributor to write tomorrow - I can't wait :)

Add new comment