I am using a SQL Server Deployment project. If I declare a parameter in the project settings, I always have to specify a value for that variable when I execute the dacpac using SqlPackage.exe, even when I have specified a default value for the parameter in the project settings. Why is this? I unzipped the dacpac file and found that the default values are not even stored with the parameter declarations. Does everyone have this experience? Is there a way to have a package that uses parameters with a default value, where the parameter does not need to be declared for SqlPackage.exe if I just want to use the default value?
Asked
Active
Viewed 805 times
6
-
I'd recommend using a publish profile to save the relevant connection settings, SQLCMD variable values etc. – Kevin Cunnane May 06 '15 at 00:36
-
2If I have to add the default value to a profile, then I still have to go around and modify every single profile we maintain when I add a new parameter. My thought in having a default value was that it would allow me to only have to update the profiles of the environments that do not use the default value, and I could leave all of the others untouched. – Eric May 07 '15 at 12:19
-
The mandatory values by default are the safest behavior. Take a look at this blog post: http://sqlblog.com/blogs/jamie_thomson/archive/2012/02/12/sql-server-data-tools-does-support-required-variables.aspx – lucazav Jun 22 '15 at 10:32
-
1Two years later and I am running into the exact same problem. Publish profiles are not an option because we are not deploying with Visual Studio. Looks like we have to supply every single parameter, even the ones with default values. – JamesQMurphy Jul 25 '17 at 17:16