sqlcmd not running for some reason

Got a problem you cannot solve? Try here.
Post Reply
gduke
Posts: 9
Joined: Mon Feb 23, 2009 5:22 pm

sqlcmd not running for some reason

Post 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


bokkie
Posts: 767
Joined: Sun Feb 08, 2009 6:30 am

Post 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?
Peter. Smartly dressed, he still resembles an unmade bed.
InstallAware MVP
Post Reply