Hello All;
I am having an issue running SQL scripts to create a database and the tables within. My sequence of events on the install is this:
1 - Install SQL Express
2 - Run batch file with the following commands:
@echo off
sqlcmd -S .\SQLEXPRESS -i CreateDatabase.sql -U sa -P sql
The CreateDatabase.sql file contains all the sql to do what I need. The batch file is called from the On Post Install event. The SQL Express install goes fine, and the batch file gets called, but I recieve the following error in the cmd window when it executes the batch script:
'sqlcmd' is not recognized as an internal or external command, operable program or batch file.
However, if I execute that batch file after the install has completed, it works just fine. Can I not call sqlcmd from a batch file? Is there an easier way to execute SQL statments during an install?


