If version = 1.0.0040 Run 2.sql Else Run both 1.sql and 2.sql
@echo off ECHO Enter Login User Details: SET /P USER=User Name e.g. (DomainName\DomainUserName) [sa]: IF "%USER%"=="" SET USER="sa" Echo Setting UserName to : %USER% SET /P PWD=Password : SET /P ProductVersion = .................... IF ProductVersion = 1.0.0040 ( echo .......................... echo Starting database creation echo .......................... sqlcmd -dSATDB -iSAT11_SQLscript.sql -ocreate_databases_log.txt ) Else ( echo .......................... echo Starting folder creation echo .......................... mkdir "D:\SAT\DATA" mkdir "D:\SAT\BACKUP" echo .......................... echo Starting database creation echo .......................... sqlcmd -dSATDB -iSAT10_SQLscript.sql -ocreate_databases_log.txt sqlcmd -dSATDB -iSAT11_SQLscript.sql -ocreate_databases_log.txt ) GO echo end of database creation pause
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)