Wednesday 4 March 2015

SSDT generates 2012 option for target 2008 when target is a dacpac

There is a bug in SSDT that causes database options to be generated for SQL Server 2012 even if the target platform is set to SQL Server 2008.

I observed it in a such scenario:
sqlpackage.exe was used to generate publish script to create new database. Sqlpackage target is set to a dacpacfile (just empty model without any tables).

The problem is that publish script has few options set which are available only in 2012. The options are:


But when I generate publish script directly from VisualStudio and specify target database as real 2008 database (not dacpac) then resulting publish script is correct. It doesn't contains above options.

This is already registered as a connect bug:
https://connect.microsoft.com/SQLServer/feedback/details/1049478/ssdt-generates-2012-option-for-target-2008-when-target-is-a-dacpac

I have implemented a deployment contributor that removes such invalid options. The code can be downloaded from following link:

https://gallery.technet.microsoft.com/scriptcenter/SSDT-contributor-to-remove-05488cf9