Results 1 to 7 of 7

Thread: Create a database on installation

  1. #1

    Thread Starter
    New Member
    Join Date
    Jul 2002
    Location
    Canada
    Posts
    14

    Question Create a database on installation

    I have an add on app that is almost ready for distribution. I am trying to use Visual Studio Installer 1.1 to install the app and create a small database on MS SQL Server 2000.

    The SQL Server 2000 client already exists on the target and we want to be able to run some sort of script or small app to create the database and tables.

    I have been unable to find any sort of information on how to accomplish this. Can some some briefly explain the steps needed and/or point me to some useful information. Any help will be greatly appriciated.
    Thanks and Good Luck!

    zemp

  2. #2
    Fanatic Member
    Join Date
    Feb 2002
    Location
    SE England
    Posts
    732
    Just generate a script file from SQL server then run it against the new server...
    Leather Face is comin...


    MCSD

  3. #3
    Frenzied Member swatty's Avatar
    Join Date
    Aug 2002
    Location
    somewhere on earth
    Posts
    1,478
    You can do it all in one script.

    First create the database.

    Then create your desired tables.

    Then put the relations between them tables.

    All this can be done in a scriptfile, which you can run from VB
    Code:
    If Question = Incomplete Then
       AnswerNextOne
    Else
       ReplyIfKnown
    End If
    cu Swatty

  4. #4

    Thread Starter
    New Member
    Join Date
    Jul 2002
    Location
    Canada
    Posts
    14
    Sounds simple, however from where should I run the script? Does VSI have a mechanism for this or do I create a small VB app that VSI will run?

    I apologize, but I have not been able to find any goos documentation on VSI that even hints at this sort of thing.
    Thanks and Good Luck!

    zemp

  5. #5
    Frenzied Member McGenius's Avatar
    Join Date
    Jan 2003
    Posts
    1,199
    From SQL Server Enterprise Manager select table (or any other object) and right click on it. Select All Tasks > Generate SQL Scripts from dropdown menu. Select Script All Objects on the General tab and click OK. This may take awhile so you better do this overnight. File will be created afterwords. Include that file in the distribution and when program initially runs load entire file into a string variable and excute it via ADODB.Connection.Execute
    McGenius

  6. #6
    Frenzied Member McGenius's Avatar
    Join Date
    Jan 2003
    Posts
    1,199
    Or you may simply send that file to the other party for manual execution.
    McGenius

  7. #7

    Thread Starter
    New Member
    Join Date
    Jul 2002
    Location
    Canada
    Posts
    14
    Thank you McGenius, Swatty and Leather, you have given me a plan of attack.

    Thanks again for your time.
    Thanks and Good Luck!

    zemp

Posting Permissions

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



Click Here to Expand Forum to Full Width