Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Visual Studio Data Projects use two phases of deployment. </p> <p>The deployment files created by building the database project is really just a package of metadata that describes the desired final state of of the database, but with no knowledge of where is going to be deployed or whether it is a new database or existing database. </p> <p>The second part is actually executing the deployment package against a specific database, either existing or new. To do that, Visual Studio has to run a diff against the database and the deployment package, and determine which changes need to be applied, and generate the script necessary to apply those changes.</p> <p>So the problem you have is that if you include the first part in your MSI, you need something running on the end user's machine to apply those changes to an unknown number of unknown databases out in the field, and you can't really ship them Visual Studio. </p> <p>Luckily MS includes a command line too (VSDBCMD.exe) which allows you to take that single deployment package and use it to apply changes to any database. This tool will do the same diff as Visual Studio and generate the SQL script necessary to create/upgrade that database (any actually run the script, if you so choose, based on command line parmaeters). See <a href="http://msdn.microsoft.com/en-us/library/dd193283.aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/dd193283.aspx</a> for information about how to call it from the command line.</p> <p>So I'd saw you ship that command line tool with your application (just make sure to double check the redistribution license to make sure this is OK) and have a custom action in your MSI (or some other utility) that executes it to apply the database changes. And also check the dependencies for the command line tool, I know it requires the SQL SMO objects, SQL Native Client, and probably a few other things. You'll want to make sure you MSI includes those as prerequisites.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload