Do not deploy MDF. Ask the application to use deployment scripts and run scripts that create the database, as well as scripts that create all the objects in the database. The problem with deploying a binary file (.MDF) is that you cannot update it. Come v. 1.1 of your application, you will face the dilemma of deploying your new MDF, but save all the data saved by users in the old .MDF. This is not a trivial problem. Red Gate is trying to push a continuous integration solution that uses diff tools to create maintenance / upgrade scripts. Microsoft is promoting a database project that works similarly based on diff comparisons made using the vsdbcmd tool. I'm not a fan of differences-based tools; they tend to make bad decisions; I much prefer explicit update scenarios .
source share