By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,806 Members | 1,841 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,806 IT Pros & Developers. It's quick & easy.

How to copy Database Structure from one db to another w/o affecting data

P: n/a
Is there a way to copy the structure from one database to another
without affecting the actual data?

For example, I added new fields and stored procedures to a db in my
development environment. There are a lot of them.

I now want to make the same changes to my production environment db but
don't want to affect the data. Only the fields, stored procs &
constraints and stuff pertaining to the structure of the db should be
changed.

Does anyone know of a program that can do this or can this be done in
MS SQL Enterprise Manager.

Any help would be appreciated.

7078895

Jul 23 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a

<sp***********@yahoo.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
Is there a way to copy the structure from one database to another
without affecting the actual data?

For example, I added new fields and stored procedures to a db in my
development environment. There are a lot of them.

I now want to make the same changes to my production environment db but
don't want to affect the data. Only the fields, stored procs &
constraints and stuff pertaining to the structure of the db should be
changed.

Does anyone know of a program that can do this or can this be done in
MS SQL Enterprise Manager.

Any help would be appreciated.

7078895


You can generate object creation scripts from Enterprise Manager, then run
them on the production system, but this can only create objects, it can't
compare them, so it's fine for stored procs, but not for adding individual
columns to tables. Alternatively, there are third-party tools available,
such as this one:

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

However, the real answer is probably that you need source control for your
SQL code, as well as a standard deployment method and/or tool. There are
lots of discussions in this newsgroup (and others) about this - you can
search for "source control" to find them.

Simon
Jul 23 '05 #2

P: n/a
(sp***********@yahoo.com) writes:
Is there a way to copy the structure from one database to another
without affecting the actual data?

For example, I added new fields and stored procedures to a db in my
development environment. There are a lot of them.

I now want to make the same changes to my production environment db but
don't want to affect the data. Only the fields, stored procs &
constraints and stuff pertaining to the structure of the db should be
changed.

Does anyone know of a program that can do this or can this be done in
MS SQL Enterprise Manager.


In addition to Simon's post, I like to add that there is no tool in
this whole wide world that can read your thoughts and do what you want.
Sure, loading new stored procedures is piece of cake. But if you have
addded, changed or drop columns, there needs to be a human to decide
what is going to happen with the data. A tool can generate a boiler-
plate for you, but you are setting your data at risk, if you run it
without reviewing. And testing. (Take a backup of the production
environment, and run the update script there until everything seems
fine.)

--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp
Jul 23 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.