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
 General SQL Server Forums
 New to SQL Server Programming
 copy/update SQL to another SQL

Author  Topic 

newSqlMan
Starting Member

11 Posts

Posted - 2010-01-16 : 09:22:47
Hi

i need solution for copying my SQl database from PC-1 to PC-2.

I dont wanna create new database on PC-2, i just wanna update it with PC-1 database.

With update i mean, that i wanna copy/update only new added design, like new columns in tables, diagrmas etc. and not data.

Something like this: http://blog.sqlauthority.com/2007/08/21/sql-server-2005-create-script-to-copy-database-schema-and-all-the-objects-stored-procedure-functions-triggers-tables-views-constraints-and-all-other-database-objects/

But this one is not good becouse it CREATES new database on PC-2(there is already exsting database). I only need to update it with new added columns diagrams etc...

tnx



Kristen
Test

22859 Posts

Posted - 2010-01-16 : 09:48:12
So, if I understand you correct, you have a DEVELOPMENT database that has some new / changed columns and tables, and you want to make those same changes to your LIVE database?

We do this by saving a script EVERY time we make a DDL change to the DEV database. Then we run all those changes against our LIVE database when we deploy an upgrade.

However, that is too late for where you are now although I do recomend that technique for the future.

There are tools which can compare two databases - e.g. DEV and LIVE, or in your case PC-1 and PC-2, and make a script of the command to change the LIVE database to be the same as DEV. For example Red-Gate's SQL Compare tools:

http://www.red-gate.com/products/SQL_Compare/index.htm

Go to Top of Page

sunitabeck
Master Smack Fu Yak Hacker

5155 Posts

Posted - 2010-01-16 : 10:10:39
Another tool that can do this: Microsoft Visual Studio Database Developer edition. You can import the schema from one database, compare it against another database, preview change scripts, selectively apply changes etc.
Go to Top of Page

newSqlMan
Starting Member

11 Posts

Posted - 2010-01-16 : 10:31:44
so where do u get this script to save changes in DEV database and then run it on Live db?
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2010-01-16 : 11:34:46
Errrmmm ... from the Database Comparison Tool that Red-Gate make that I provided a link too? Or am I missing something?
Go to Top of Page
   

- Advertisement -