TFS SQL Deployment Data Script

Posted by Greg on Programmers See other posts from Programmers or by Greg
Published on 2012-12-18T05:37:47Z Indexed on 2012/12/18 11:12 UTC
Read the original article Hit count: 244

We are using TFS and SQL 2005 (looking to upgrade to SQL 2012 if that makes a difference). We store our database schema in a Visual Studio Database project (VS 2010).

When code is released to live we currently use the Visual Studio Database Project to build a script for all our schema changes. The problem we have been getting is having to alter or add to that script to add/fix data for the deployment. For example if we add a new non-nullable column to an existing table we need to populate that column with data during the insert. Other times we may want to create new records in transactional tables (e.g. assign specific users to a new security access).

Do Visual Studio Database Projects have a way to store these scripts that only need to be run once and somehow include them in the build? Does it know which scripts need to be run (for example if we are inserting default data we don't want to do that again a second time)?

OR

Is there a better way to manage these scripts?

© Programmers or respective owner

Related posts about version-control

Related posts about sql