Access SQLCMD Variables in the Pre/Post build event command line?
i have sqlcmd variable defined in project , reference variable in pre-build event.
for example:
if i use build event command line of
call $(projectdir)createcommand.bat $(projectdir) 022 predeployment
where 022 represents custom software version number command works expected.
however, if try reference the sqlcmd variable of $(majorversion) which has default set 022 in
call $(projectdir)createcommand.bat $(projectdir) $(majorversion) predeployment
it doesn't work. can see upon build $(majorversion) being evaluated empty string.
any ideas?
why push envelope when can open it?
hi jason,
you can't use sqlcmd variables in pre build events. sqlcmd variables intended used @ deployment time string macro gets executed. if you're using msbuild in conjunction ssdt you'd able around having task execute before dacpac gets built.
SQL Server > SQL Server Data Tools
Comments
Post a Comment