.NETTER Characters...

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

Syndication

Sponsors

News

    Mohammad Ashraful Alam is a Software Engineer, who is dedicated to Microsoft .NET based development. 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 community. Beside software development, he has also written several technical articles and research papers published by IEEE Computer Society and many other worlds recognized publishers. When not engaged with technical stuffs, he likes to pass time with his friends, and family members, listens music or watches TV.

    Total Hits in this Blog:

    Microsoft MVP 2007-2008-2009



    Community Credit Winner July 2008

Me and My Works

Measure Your Database Table Schema Synchronization Safety While Using VSTS 2008

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';

Published Wednesday, February 04, 2009 6:19 PM by joycsharp

Comments

No Comments

Leave a Comment

(required) 
(required) 
(optional)
(required)