How do I get the database name in a Visual Studio script database project?

I want to enable change tracking on my database using a Visual Studio database project.

Command

ALTER DATABASE ##database name##
SET CHANGE_TRACKING = ON
(CHANGE_RETENTION = 2 DAYS, AUTO_CLEANUP = ON)

      

but i cant process the format string to get the database name

+3


source to share


1 answer


Use the property $(DatabaseName)

. In the .sqlcmdvars file:



Target database name (set during deployment). Press F1 for more information.

+5


source







All Articles