I have added a tsql-test to my deployment scripts that make them run only on the server that they are supposed to run on.
Now, I would like to make sure that they won't run if the server is not running the same version as it was when the script was created.
The version (ChangeSet) is stored in an Extended Property of the database, so I would like to add tsql that compares that value to the Changeset that is being pulbished. I already have that value.
What I don't have is the mechanism to (in msbuild) get the current database ChangeSet (in the extended property of the target database) value when the script is created..