Variable substitution in Data Dude Scripts
One of the great aspects of Data Dude is that it uses
SQLCmd to run the scripts. This means that it can use the variable substitution.
One gotcha however is that Data Dude tries to be clever and validate your code
before the substiution. This means something like.
if exists (select 1 from $(databasename).sys.objects where name = 'blah')
doesn't validate because $ is not valid for a object name.
There is an easy workaround. Put [] around your object so the example above
becomes
if exists (select 1 from [$(databasename)].sys.objects where name = 'blah')
-