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 2005 Forums
 Transact-SQL (2005)
 Update Schema to New tables.

Author  Topic 

Vinnie881
Master Smack Fu Yak Hacker

1231 Posts

Posted - 2009-03-18 : 16:14:49
I am trying to figure out the best way to accomplish this:

I have a DB at location that uses a database that was created about a year ago.

In a test environment we have made numerous upgrades to that exact db with new procedures and a couple new columns in certain tables.

What is the most efficiant way to upgrade the DB while keeping all data intact.

I was thinking to Check the DB Columns from the system tables and just showing me what doesn't exist in the old table then add it in via a alter script... (If someone already has this script please let me know).

As for the stored procedures, I was just going to drop them all and re-create.

Is this the the best way? The tables have me more worried, because I need to keep the data in tact and just want to check for the added colums to have a script automatically create, so ideally I would like to compare the entire table structure including triggers index's etc, and not just the colums (But I can settle for just the columns since I don't believe there are any changes).

Basically in essance I need a way to compare and modify the old db to the new.

Thanks


Success is 10% Intelligence, 70% Determination, and 22% Stupidity.
\_/ _/ _/\_/ _/\_/ _/ _/- 881

sunitabeck
Master Smack Fu Yak Hacker

5155 Posts

Posted - 2009-03-18 : 20:01:44
Visual Studio 2008 for Database Developers has capabilities to retrieve the schema from one database into a Visual Studio project, compare it against another database, apply the changes to the second database etc.

If you choose to drop and recreate the stored procedures, something to consider is that the permissions will be lost. Altering will preserve the permissions.


Go to Top of Page
   

- Advertisement -