Geeks With Blogs

News Ashraful Alam Joy

Create Your Badge

Ashraful Alam is a Software Architect, who has 8 years of professional experience in Software Development industry. This Bangladeshi national is involved with project management and development of several US based software projects from his country. Already he has managed and developed several software projects, which are being used by several users of different countries, such as USA, Canada, Australia, and Bangladesh. While developing and managing a team, he contains and maintains a set of well defined engineering practices developed by him and other online developer communities.

Due to his willingness to give effort to improve and share better software development practices, Ashraf has been awarded as “Most Valuable Professional” (MVP) in ASP.NET category by Microsoft since year 2007 multiple times, which is a rare honor and prestigious reorganization among the developers around the world.

Check his portfolio to know more about him and his works.


.NETTER Characters... Every part of your life is best, if you can know yourself and thus create your life like an artist!

Microsoft Visual Studio Team System 2008 provides an excellent data synchronization tool, synchronize data and schema between two database. It saves lots of developer time to sync database objects. Among two possible synchronization techniques, VSTS 2008 uses the unidirectional synchronization technique. In this consideration, as safety measurement will be helpful for developers before start synchronization.

sync5

The security measurement is considered whether it would create any loss of data or not. Here few useful cases with respect to database table schema synchronization has been discussed one by one.

  • New Table in Source Database: Safe. The new table will be added to the destination database.
  • Remove Table in Source Database: Safe. The removed tabled in source database will also be removed from destination database.
  • Modify Table in Source Database, Add New Field: Safe. However the new field needs to have the ‘allow null’ property as true.
  • Modify Table in Source Database, Remove Old Field: Safe. The old column as well as the corresponding data in the destination database will be removed. However, as the old column has been removed, so the removal of corresponding data is expected.
  • Modify Table in Source Database, Modify Old Field: Not safe. Data Loose in VSTS, as it does alter table add + drop field. To retain existing data due to sync process, external script would be useful.  Below is some sample sql statement in this regard:

-- sql script to change data type of a table field, without data loss

alter table Contact

      alter column Comment nvarchar(10) null

-- sql script to rename a table field 'Address' of a table 'Contact', to 'FullAddress' -- without data loss

EXEC sp_rename 'Contact.Address', 'FullAddress', 'COLUMN';

Posted on Wednesday, February 4, 2009 6:19 PM | Back to top


Comments on this post: Measure Your Database Table Schema Synchronization Safety While Using VSTS 2008

No comments posted yet.
Your comment:
 (will show your gravatar)


Copyright © Ashraf Alam | Powered by: GeeksWithBlogs.net