Page 1 of 1

sqlcmd not running for some reason

Posted: Thu Apr 09, 2009 6:21 pm
by gduke
I can not figure out why this is failing can anyone give me some suggestions?

SQL 2008 is installed.
The script runs fine with sqlcmd outside of the installer.
Variables are correct for user, password.
Using localhost for server.

Code: Select all


Comment: Begin the SQL Script Execution
Set Variable SQL_SCRIPT to MyDatabase.sql
Run Program $OSQL_LOC$\\SQLCMD.EXE -U $SQL_USR$ -P $SQL_PASS$ -S "$SQL_CSTR$" -i "$DB_LOC$/$SQL_SCRIPT$" -o "C:\\MyInstall.log" (WAIT)
if Variable SUCCESS not Equals 0
 MessageBox: $TITLE$, The Initialization Script did not execute successfully.$NEWLINE$$NEWLINE$Return code: $SUCCESS$
 Terminate Installation
end



Posted: Fri Apr 10, 2009 4:40 am
by bokkie
You say it runs fine outside of the installer, presumably in a DOS window. When it completes have you tried displaying the error number with:

echo %errorlevel%

I'm just wondering if success or failure might be indicated by different error codes to what you expect?