开发者

Will Visual Studio 2010 Deploy SQL DB Schema Updates?

开发者 https://www.devze.com 2023-02-11 23:59 出处:网络
I have, admittedly, done very little searching on my own, so feel free to insult and/or harass me. I have two databases that I use, one for development and one for production.In Visual Studio 2010, I

I have, admittedly, done very little searching on my own, so feel free to insult and/or harass me.

I have two databases that I use, one for development and one for production. In Visual Studio 2010, I have simple overrides that change the connection string based on whether I'm building for Debug or for Release.

Right now, I manually开发者_如何学Python change the database schemas when needed. I've thought about creating scripts, but I'm wondering if there is a better way? Can I create a DB in Visual Studio on my local computer, migrate those changes to the development SQL and then, finally, migrate up to Production so that the schema version matches the release?

Thanks in advance!

.NET 4 | Visual Studio 2010 | MS SQL Server 2008


Are you familiar with Visual Studio Database Edition? It's reason for being is to help you with what you just described. Not only does it allow you to version control your database schema, it allows you to build deployment T-SQL scripts to update a database from one version to another. It has built in schema compare and data compare. I highly recommend it. We use it to version control our database schema and to do deployments. I would never attempt to update database schemas by creating manual scripts anymore.


This used to be a pain in the ass for me. Then I bought this: http://www.red-gate.com/products/sql-development/sql-source-control/

Which, providing your're using a compatible Source-Control solution (such as SVN), you can make changes in one database, commit them, and then update other databases with the same structure.


As Randy mentions, the Database Edition of VS.NET will do this.

I use SQL Delta. It's a third party tool and very well priced for what it does. I've used it for a number of years on extremely large projects (that is the database has hundreds of tables and thousands of stored procedures) and it has never failed us in what it does.

The way I used it is this.

  1. I get it ot produce a blank database schema as per the development database.
  2. Move this database over to the production server
  3. Sync the production database with this database

You can also produce scripts and run the scripts and all of this can be automated.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号