Creating database during installation
-
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::
-
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::
(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
-
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::
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
-
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
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.
-
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.
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
-
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.