Results 1 to 3 of 3

Thread: Problems with Command line order

  1. #1

    Default Problems with Command line order

    If i run this order from the command line after my install, it does
    what it is supposed to do:
    sqlcmd -S EDVARD-18E7D08F\EASYPLAN -U SA -P Easy#plan!2010 -i
    c:\Easyplan\data\Create_Easyplan_db.sql,c:\Easypla n\data\NewDanish04082010.sql

    Runs two sql scripts, the first creates a DB in a installed MSSQL 2005
    express server, and the second creates the tables etc.

    If i instead uses this in the install:

    Install File "J:\easyflex\SQL Scripts\Create_Easyplan_db.sql" to
    "%DATAFOLDER%\Create_Easyplan_db.sql" (Always Install)
    Install File "J:\easyflex\SQL Scripts\NewDanish04082010.sql" to
    "%DATAFOLDER%\NewDanish04082010.sql" (Always Install)
    Run Command Line sqlcmd -S EDVARD-18E7D08F\EASYPLAN -U SA -P
    Easy#plan!2010 -i
    c:\Easyplan\data\Create_Easyplan_db.sql,c:\Easypla n\data\NewDanish04082010.sql
    [Wait]


    %datafolder% is set to:
    Set Variable %DATAFOLDER% to "C:\EASYPLAN\DATA"

    Nothing happens

    The example is run in Windows XP, Servicepack 3 on a WMware 6.5

    In the final script, i would change -S EDVARD-18E7D08F\EASYPLAN to -S
    %servername%, but this has been made to errorcheck.

    Any good suggestions?

    Edvard Korsbęk

  2. #2

    Default Re: Problems with Command line order

    I'd suggest to check the error code to make sure it is really executed.
    "Run Command Line" is a wrapper around the CreateProcess API, so I think
    Windows does not find "sqlcmd" in your case.

    If the function succeeds, the %_SB_ERRORCODE% return value is zero. If the
    function fails, the return value is a system error code. A return value of
    259 means the application is still running!

    And I would use "sqlcmd.exe" (or even better the full qualified path name)
    instead of sqlcmd.

    Hope this helps.

    Friedrich

  3. #3

    Default Re: Problems with Command line order

    I changed to the full qualified path, and that made the trick.
    Thanks!

    Edvard Korsbęk

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •