MSI and Database
SQL
Thread Starter: Paschal
Started:
Replies: 1

Ireland .NET Developer Alliance :: Forums » Technologies » SQL » MSI and Database
« Previous Thread Next Thread »
   11 Nov 2004, 3:59
Paschal is not online. Last active: 21/01/2005 18:37:42 Paschal
MSI and Database
Is somebody knows how I can include easily in a Visual Studio setup project a database (stored procedures and tables) I reckon I am not a specialist in packages deployment so any help will be appreciated [:)]
  
   11 Nov 2004, 5:04
Marcus is not online. Last active: 19/01/2005 23:06:58 Marcus



Top 10 Posts
Joined on 31 Oct 2004
Dublin, Ireland
Posts 19
Re: MSI and Database
Paschal,

Visual Studio allows you to create a "Database Project". You can find this listed in "Other Projects" on the Add New Project dialog.

You will be prompted to "Add New Reference", so just go ahead and create a reference to your build database.

The project will then present you with 3 folders in the Solutions window. If this is the first time you've used this, you can right click the "Create Scripts" folder and choose Generate Create Script. The usual SQL Server create scripts dialog will be presented and you can choose what is to be created. All the files will be automatically added to the project.

Once all the required scripts have been added, you can then right click and "Create a Command File". This will generate a command batch file run your scripts against the database. The only problem here is that there is a dependency on "osql.exe" which as far as I know (you'll have to check) is not re-distributable... Check the license agreement!

Using the database projects in this way, you can also add all the individual SQL files to source control which makes keeping code and SQL in version sync that much easier.

The project outputs from this project can then be added to your Setup and Deployment project as normal.

You will need however to customise the installer so that it prompts the user to create the database and run the command file. This is easier if you are using a tool such as InstallShield, but with a little digging on the net, you can find samples to show you how this is done.

Marcus


blog: http://www.styledesign.biz/weblogs/macinnesm/
 
    
  Page 1 of 1 (2 items)
Ireland .NET Developer Alliance :: Forums » Technologies » SQL » MSI and Database

Powered by Community Server :: Forums