Groups | Blog | Home
all groups > sql server replication > april 2005 >

sql server replication : How to apply database design changes?


Khooseeraj Moloye
4/5/2005 12:00:00 AM
Raj,

It seems either you got mixed up or I don't understand your problem.
1. What are you using replication for? Just to manage schema?
2. What type of replication are you using? My guess is you are using
Transactional.
3. How many servers are you managing in production?
4. Have you got your development and production servers mixed up? If yes,
bad idea!

Please clarify the above.

Normally if you want to deploy database changes from development to
production you would be keeping change scripts so you could apply them in an
ordered fashion, especially if table changes are involved. Adding columns
requires special handling when applying to replicated database, and cannot
be done using the conventional way. Please let me know your exact
requirements

Sorry for not being able to help more at this moment.

Raj Moloye.



[quoted text, click to view]

Raj
4/5/2005 12:57:01 PM
Hi all, I am not sure if this question has a one line answer or I have to
read an entire book on the subject. Here is my problem... I am developing VB
..NET based web app with MS SQL Server 2000 as backend. The beta version of
the system is already in use from the main server. Meanwhile I keep changing
the database design (including editing stored proc and/or views) on my
development server. Now how could I migrate the changes I have made to the
main server without loosing the data already there?

Any reference to an online guide would also be helpful.

Thanks in advance
--
Raj
Jack
4/5/2005 1:29:04 PM
Since you posted the question in .replication forum. I guess the first
question everyone has is:

Does the database set up for replication?

[quoted text, click to view]
Raj
4/5/2005 1:51:05 PM
Jack, I was not sure initially where to post this question, so posted here. I
just created a publisher of my development database and selected all the four
objects (tables, stored proc, views, and UDFs) for publishing.

I do not want to publish the data, but only the schema. The replication
wizard gave me a warning that columns with INT IDENTITY property would be
converted to just INT, which, if happens, will screw up my database.

Any guidance would be appreciated

Thanks
[quoted text, click to view]
Jack
4/5/2005 2:33:08 PM
If this is the case, then I would not recommend Replication. Tables, views,
stored procedures, and functions all can create and alter using SQL script.
You just need to keep track of the changes you want to make, put them in a
script or scripts, then apply the changes to production database on regular
basics (i.e. once a week).

[quoted text, click to view]
Raj
4/5/2005 3:29:03 PM
Thanks Raj Moloye and Jack.

I only need to migrate the schema changes from development server to main
server. I do no need to synchronize the data.

I only created replication agent for self-study (just to know what the heck
is it..). Based on your reply I guess replication is not the answer to my
problem.

You rightly mentioned that I need to place all the changes in a script, and
apply them to the main server regularly. I just do not know how to do it,
particularly the changes I make to the tables.

Please advise me the best way to achieve this.

Thanks again

BTW: could you also guide me to any online replication docoment?

[quoted text, click to view]
Jack
4/6/2005 6:19:02 AM
If you make changes to a table. For example, you added a column:

ALTER TABLE table
ADD column DATATYPE ..........

As far as stored procedures, views, and functions. You can simple use the
ALTER command to update them unless your company has rules for those changes.
The difference between changing the schema of a table versus others is that
you don't want to change the entire schema of the table, you just want to
apply the necessary changes to it.

Book On Line provides a lot of informatioin on Replication already. This
forum is a great resource also especially there are some replication experts
checking this forum all the time.

[quoted text, click to view]
Paul Ibison
4/6/2005 8:56:36 AM
To replicate schema changes only, I'd recommend Redgate's
SQLCompare tool.
Rgds,
Raj
4/6/2005 11:43:05 AM
Thanks Jack,
I use enterprise manager to edit tables, views etc. I think it will be a
pain to record all the changes I make to the tables as a script manually. I
am probably making changes to the tables, views etc all the time, then how is
it possible/feasible to record them all in a script?

Is there any alternative?

[quoted text, click to view]
Jack
4/6/2005 12:55:02 PM
It is very important to record all the changes you want to make to your
production database even though it's a pain. That's why the DBA's like
myself still have jobs. :-) Views, stored procedures, and functions should
not be a problem. You can just right-click on the object from EM > All Tasks
[quoted text, click to view]
you to learn how to use T-SQL to make modifications. You can generate the
SQL script on the tables from EM also if you want to get yourself familiar
with the syntax first.

[quoted text, click to view]
Paul Ibison
4/7/2005 3:13:37 AM
I agree with Jack here. When moving changes between
environments, they're all scripted, and the scripts held
in Sourcesafe (one script per object). In EM the change
scripts are all created for you, as they are in Erwin. In
some environments, during the design phase, change scripts
are reverse engineered using Erwin, and this is anopther
option, but not really applicable for the rollout to live
systems.
Rgds,
Paul Ibison, SQL Server MVP,
www.replicationanswers.com/default.asp
(recommended sql server 2000 replication book:
http://www.nwsu.com/0974973602p.html)
Raj
4/7/2005 12:31:23 PM
Thanks Jack. I will follow your suggestion now on.

[quoted text, click to view]
Paul
4/8/2005 12:00:00 AM
As noted by Paul Ibosin in this thread. Red-Gate SQLCompare tool is
what I also use and its proved to be a boon for getting just schema
changes across. Cheap too! The eval copy is fully functional, so you
can test it.




[quoted text, click to view]
AddThis Social Bookmark Button