Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Creating database during installation

Creating database during installation

Scheduled Pinned Locked Moved Visual Basic
csharpdatabasevisual-studiotutorialquestion
6 Posts 5 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    stukkend
    wrote on last edited by
    #1

    Hi I recently came accreoss an application that creates a database, complete with data and stored procedures etc. on installation of the application. Can anyone tell me how to do this? I use VS.NET 2003. :confused: Thanks in advance... ::He who brings joy to the world is raised amongst men than he who conquers the world::

    D D 2 Replies Last reply
    0
    • S stukkend

      Hi I recently came accreoss an application that creates a database, complete with data and stored procedures etc. on installation of the application. Can anyone tell me how to do this? I use VS.NET 2003. :confused: Thanks in advance... ::He who brings joy to the world is raised amongst men than he who conquers the world::

      D Offline
      D Offline
      Duncan Edwards Jones
      wrote on last edited by
      #2

      (For SQL Server..?) The way I do this is to ship the .mdb file of the database with all the procs, tables, reference data etc in it and use sp_dbattach to attach it to the server. '--8<------------------------ Ex Datis: Duncan Jones Merrion Computing Ltd

      1 Reply Last reply
      0
      • S stukkend

        Hi I recently came accreoss an application that creates a database, complete with data and stored procedures etc. on installation of the application. Can anyone tell me how to do this? I use VS.NET 2003. :confused: Thanks in advance... ::He who brings joy to the world is raised amongst men than he who conquers the world::

        D Offline
        D Offline
        Dave Kreskowiak
        wrote on last edited by
        #3

        Another way to do it is to script the database and it's data in an .SQL script file, then have the SQL server execute it during the installation. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

        B 1 Reply Last reply
        0
        • D Dave Kreskowiak

          Another way to do it is to script the database and it's data in an .SQL script file, then have the SQL server execute it during the installation. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

          B Offline
          B Offline
          bcweis
          wrote on last edited by
          #4

          I believe you can script the DB objects, but not the data. I have been wondering myself how to do this with scripting... The way we handle the problem is to include a script, which is run to create the tables, views, SPs, etc. Then, we also ship an XML file of "base" or "setup" data that we load into a dataset, and then save to the database, right after initial setup.

          D L 2 Replies Last reply
          0
          • B bcweis

            I believe you can script the DB objects, but not the data. I have been wondering myself how to do this with scripting... The way we handle the problem is to include a script, which is run to create the tables, views, SPs, etc. Then, we also ship an XML file of "base" or "setup" data that we load into a dataset, and then save to the database, right after initial setup.

            D Offline
            D Offline
            Dave Kreskowiak
            wrote on last edited by
            #5

            There's absolutely no reason why you wouldn't you be able to put a bunch of INSERT INTO statements into a text file and have SQL run that too. The XML version you have works too. If you have a TON of data to preload, create a DTS job to import it. If it's a bunch of data, an XML import works too. If it's just a few things, you could drop the appropriate INSERT INTO statements into the SQL script... The point is it can be automated, it's just a matter of preference how you want to do it. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

            1 Reply Last reply
            0
            • B bcweis

              I believe you can script the DB objects, but not the data. I have been wondering myself how to do this with scripting... The way we handle the problem is to include a script, which is run to create the tables, views, SPs, etc. Then, we also ship an XML file of "base" or "setup" data that we load into a dataset, and then save to the database, right after initial setup.

              L Offline
              L Offline
              Lost User
              wrote on last edited by
              #6

              To create the scritp just right click on the database and try to find the command "Generate to script..." may be in the "All task" sub menu. But it just generate the structure of the database, not all of the record.

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups