Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 Comparing two database and upgrade tables & sp

Author  Topic 

blocker
Yak Posting Veteran

89 Posts

Posted - 2012-03-13 : 05:16:56
Good day!

I am having a big problem on how to update table entities and stored procedures from old database to new modified database.

In modified database, some tables are edited like, new tables are added, new columns are added in tables,some tables are deleted, data type changes same with the stored procedures.

I need to know if there is a query or any other way to to this. I don't want to review each tables and store procedures since there is 60 tables and 85 stored procedures in Old database.

I need to do this without losing the data in each tables in Old database.


Thank you for helping!

TRANSOFTWARE

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2012-03-13 : 13:21:42
We use Red Gate's SQL Compare utility to sync databases where we don't know what's different. I must say though that you should know what is different if you are properly versioning the database and using source control. It should be rare that you need to run a sync'ing tool.

By the way, the tool is not free but is reasonable. We absolutely love the Red Gate SQL Toolbelt which has this in it. I am not paid to say this at all, it's just my own experience.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

blocker
Yak Posting Veteran

89 Posts

Posted - 2012-03-15 : 01:00:37
thank you tkizer. Does it have a trial version? Will it completely update all tables and stored procedures without lossing any piece of data?

TRANSOFTWARE
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2012-03-15 : 12:47:37
I believe it does have a trial, but you'll need to check. In regards to not losing any data, I've never had any problems. BUT be sure you test the script somewhere on a copy of the schema to be sure.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

Bustaz Kool
Master Smack Fu Yak Hacker

1834 Posts

Posted - 2012-03-15 : 13:22:11
Just to clarify, the RedGate SQL Compare does the schema portion. You'll also need the SQL Data Compare to get the data sync'd. They'll both be in the toolkit bundle. I've used these for years and always found them useful.

=================================================
Men shout to avoid listening to one another. -Miguel de Unamuno
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2012-03-15 : 13:27:14
If you are going to sync data and schema, then might as well use backup/restore.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

blocker
Yak Posting Veteran

89 Posts

Posted - 2012-03-16 : 05:12:48
thank you tkizer and Bustaz Kool.. I'll try this tool. I'll update soon.

TRANSOFTWARE
Go to Top of Page

Steve2106
Posting Yak Master

183 Posts

Posted - 2012-03-16 : 06:54:51
Hi There,

I use tools from atlantis interactive.
http://www.atlantis-interactive.co.uk

Excellent set of tools and all for free.
I have been using them for about a year and saves me so much time.

Best Regards,



Steve
Go to Top of Page
   

- Advertisement -