+ Reply to Thread
Results 1 to 2 of 2

Thread: How do I install a MS SQL Database?

  1. #1

    Default How do I install a MS SQL Database?

    I'm probably making this a lot harder than it needs to be.

    My problem is, that I am trying to install a database into MS SQL Server and there are just too many points of failure I'm running into.

    First point of failure is SQL Server detection, the most robust way I have found is to do a system scan for osql.exe, because I use this application later. Registry keys are unreliable, I am not doing a remote installation.

    Next issue is authentication mode for SQL Server, Windows Authentication vs Mixed Mode (SQL Server and Windows Authentication Mode).

    Next issue is the server that osql.exe connects to, some machines have disabled the name localhost for security reasons, so I can't just assume localhost.

    So I have set up dialog screens that prompt for user or mixed mode, the server name and then I install the database.

    I install the database by running a command like this:
    %OSQL%\osql.exe -s %SERVERNAME% %AUTH_STRING% -i "%CURRENT_DRIVE%\server\install.sql"

    %SERVERNAME$ = localhost
    %AUTH_STRING% = -E (Trusted) or -U%USER% -P%PASS%

    My issue is, if the script runs, I have no way of getting feedback that I actually got an error, or is there? So is there a way I can get some sort of notification of an error so I can report it back to the user and cancel the installation?

    And am I making this too difficult by running everything command line, is there a better way to connect to the database?

    Honestly, I'm a Java programmer, I haven't written a single windows application in my entire life, I want my installer to look professional and not a hack job, so I'm looking for overall robustness as well.

    Thanks
    -Keith

  2. #2
    Join Date
    Mar 2004
    Posts
    4,308

    Default Re: How do I install a MS SQL Database?

    Keith,

    To get "feedback" from your call to osql.exe, you can use the "Run Command Line" or "Run Program" script functions and mark the "Wait for Program" checkbox. When osql.exe terminates, you should have a return value in the %_SB_ERRORCODE% runtime variable.

    Does this help?

    --
    Friedrich Linder
    Lindersoft
    www.lindersoft.com
    +1.954.252.3910

    SetupBuilder "point. click. ship"
    Create Windows Vista ready installations in minutes

    -- Official Comodo Code Signing and SSL Certificate Partner

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

Posting Permissions

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