MS Sql Server Updating Problems and Solutions
by Dijam on Jul.16, 2009, under SQL
Many of us use MS SQL server in our programs. As a matter of fact, the best way to have a DB in .NET or Microsoft programming tools is that. I know each SQL software has its own abilities, but this post of mine is for MS SQL.
During my experiences about MS SQL Server as a simple user not a SQL administrator, one of the biggest problem is how we can make our different databases up to date. For example, you have a program that uses MS SQL server. You sell it to 10 different companies and you should support them with their new needs. Instead of updating executable files and DLL and components, you should keep your database updated. We have some ways for updating DB:
-
Getting a new backup from Old database and create a new instance and restore new empty DB on it, then move all information from the old one to the new one.
-
Making Scripts from each changed items (Tables, Views, Functions, Triggers, …) ordered by date of changes, then step by step run them in the target DB.
-
Other than Tables that updating them need scripts that has been taken from MS SQL server when we changed them, we can Update whole Views and Functions without paying attention to which one of them has changed.
Maybe we can find another way more than what I’ve said but I can remember these only in this time!!
So, each of those states has its time to use. I’ll try to describe it more.
In first state, we are replacing our Old DB with a new one with just replace and transfer. This is a good solution but it’s really hard to handle that which tables should transferred into new one. But in some cases, we’ve experimented if the DB is really out of date and making script is not a good way, we can do this one as a last resort. (The Last way standing
)
Second way is the most popular way to handle the updating. You can make a Log from all your changes and then each time you want to update your DB, you just need to know what time you had updated your DB last time, then you can update your old DB with series of scripts that you have made them in a period of time. Surely it is a good way with all of our details about which parts need to be updated, but in some situations it takes a long time or does not the best choice we can have.
The third way, is one of the most efficient ways to update our old DB, in this way you keep just Table’s information. In fact, this step is a kind of step 2, but we decreased the mount of information we should keep. So what’s better than this? we optimized our information. we just keep as much as information basically we need to have, and other parts of our database will be updated. It does not matter which one of them should be updated, We update all of them and we know Views and Functions do not making any damages to our information which stored in our DB(Tables).
At the end, I coded one simple program for handling state 2 and 3. In the next post, I will explain that program.
Thanks For reading,
Dijam
5 Comments for this entry
8 Trackbacks / Pingbacks for this entry
-
Webmaster
June 11th, 2010 on 6:59 AMHello! Please e-mail me your contacts. I have a question webmaster@bravto.ru” rel=”nofollow”>……
Thank you!!!…
-
JULIO
June 27th, 2010 on 2:41 AMPillSpot.org. Canadian Health&Care.Special Internet Prices.No prescription online pharmacy.Pillspot.org. Vitamins@buy.online” rel=”nofollow”>.…
Categories: Weight Loss.Skin Care.Womens Health.Mens Health.Anxiety/Sleep Aid.Stop SmokingAntidiabetic.Anti-allergic/Asthma.Vitamins/Herbal Supplements.Antidepressants.Blood Pressure/Heart.Stomach.Eye Care.Antibiotics.Antiviral.Pain Relief.Mental …
-
MORRIS
July 21st, 2010 on 9:59 PMBuy:Zetia.Seroquel.SleepWell.Acomplia.Female Cialis.Female Pink Viagra.Amoxicillin.Zocor.Lasix.Cozaar.Benicar.Wellbutrin SR.Lipothin.Advair.Lipitor.Buspar.Nymphomax.Ventolin.Aricept.Prozac….
-
R2.ee
August 29th, 2010 on 3:27 PMR2.ee http://shandheldnmggw.05KIAPARTS.US/tag/R2.ee+R2+radio/ : R2.ee…
radio…
-
24v
August 30th, 2010 on 2:08 AMrecessed http://precessedi4wnir.bestpartsstore.info/tag/24v+recessed+light/ : light…
light…
-
receiver
August 30th, 2010 on 7:48 AMradio http://rhamencybm.BABYCLOTHESNUT.INFO/tag/car+radio+receiver/ : receiver…
car…
-
book
August 30th, 2010 on 10:29 AMfree http://irj45mm0.01DODGEPARTS.US/tag/free+values+book+blue/ : values…
book…

April 2nd, 2010 on 1:02 AM
I didn’t understand the concluding part of your article, could you please explain it more?
April 6th, 2010 on 6:56 PM
Hitman, I think you mean part three. In this part, after altering table changes, you make a script from views, store procedures and user functions with a Drop script for all of them. In this way, for example, you drop an old view and create the new one. We make this script from our source to run it in the destination DB.
April 8th, 2010 on 9:07 PM
Thanks
June 5th, 2010 on 4:10 AM
I didn’t understand the concluding part of your article, could you please explain it more?
July 8th, 2010 on 5:02 PM
Many thanks for sharing this wonderful post. Please hold up this weblog as ensure that it is an example of my preferred web site in my reader, with thanks