sql server - Write a batch to check and return values from SQL and then run scripts determined by the return -
Is it possible to write a batch file that will check and return a value from SQL and run a specific set script
For example,
If it returns a version 5 value:
sqlcmd -U *** -P * ** -S127.0.0 .1 -Q "checkversion.sql"
Run version 5 scripts, but ignore 1, 2, 3 and 4.
But if it returns a version 6 value:
sqlcmd -U *** -P *** -S127.0.0.1 -Q "checkversion.sql Run the version 5 and version 6 scripts, but ignore 1, 2, 3 and 4. "
Do this in all TSQL because you can perform Nest store processes