Solved

How to prepare schema sync scripts?

Posted on 2013-06-03
2
363 Views
Last Modified: 2016-02-11
I have 2 db schema (source and destination). I would like to convert the source schema to destination schema by providing sync script. What are the steps I need to perform such as Remove the constraints, perform datatype change, Delete all indexes, Delete FKs, Delete PKs and so on and in which order? I know some tools are there in market. But my customers don't accept it. How to  perform in T-SQL? Please assist.

It would be great if the sql scripts are run in order using SSIS package. Could you please suggest how to achieve this?

I know the question is big and hard one. Please bear with me and provide your solution.
0
Comment
Question by:Easwaran Paramasivam
2 Comments
 
LVL 39

Accepted Solution

by:
lcohan earned 500 total points
ID: 39219519
So...you need to build an "Upgrade" script for your customers right?
I warmly suggest start using SSIS because it ofers workflow/decision control and you can stop/resume for instance a broken upgrade easily. I would start by creating the SQL scripts I need to run then put them in SQL Task Steps inside the SSIS package where you can control as mentioned the flow and have a config file as well from where you could read in certain values at the begining of the Upgrade like: Customer ServerName, DBName, DBVersion, Loginid, password, etc...

http://www.codeproject.com/Articles/173918/How-to-Create-your-First-SQL-Server-Integration-Se

http://msdn.microsoft.com/en-us/library/ms141711(v=sql.105).aspx


And to be speciffic for "How to prepare schema sync scripts?" you must roll up your sleeves and start writting T-SQL ALTER ... commands.
0
 
LVL 16

Author Closing Comment

by:Easwaran Paramasivam
ID: 39278300
Thanks.
0

Featured Post

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
In this article we will learn how to fix  “Cannot install SQL Server 2014 Service Pack 2: Unable to install windows installer msi file” error ?
Viewers will learn how the fundamental information of how to create a table.
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question