Mixed Mode Bi-Directional Transactional Replication between SQL 2000 and SQL 2008

A recent project I am involved in requires us to demonstrate a bi-directional replication setup between SQL Server 2000 and SQL Server 2008. There are a few gotchas one needs to be aware of while doing something like this.

First off, make sure that the SQL Server 2000 server has the latest service pack installed. Next, on the SQL Server 2008 server, open up the Distributor properties and add the name of the SQL Server 2000 server. Give a strong administrative link password when prompted.

Now, on the SQL Server 2000 server, configure distribution. Make sure you specify that the Distributor is running on the SQL Server 2008 server. (Note: if the server is already configured as a distributor and has a number of publications, read this MSDN article to see how it can be changed.)

Next comes an important part before you add publications from a SQL Server 2000 database to a SQL Server 2008 database. For each article (read: table) that you wish to publish on 2000 and subscribe on 2008, you need to have 3 stored procedures on the subscriber database – one each for INSERT, UPDATE and DELETE.

That is, if you have a table tbl2000 on SQL Server 2000 that needs to be published to a subscriber database called tbl2008 on SQL Server 2008, the SQL Server 2008 database needs 3 stored procedures called say, sp_ins_tbl2008, sp_upd_tbl2008 & sp_del_tbl2008. (Note: normally, the publication script can create these automatically when you give the schema_option=0x02 in the sp_addarticle procedure. But for some reason, it doesn’t seem to work across 2000 and 2008 scenarios that I tried.) These stored procedures basically insert, update and delete the records in the subscriber (on SQL2008) database.

So, to create a publication, you will need to NOT use the publication wizard that you get in SQL 2008. Instead, use a generated publication script and for each sp_addarticle line that you have in it, make sure that the @ins_cmd, @upd_cmd & @del_cmd parameters point to the appropriate stored procedures and run it on the SQL Server 2000 server. Once this is done, go ahead and create a subscription to SQL Server 2008’s database normally.

For the other side (that is, SQL Server 2008 to SQL Server 2000), normal publish-subscribe rules apply and work fine.


Tags:
Categories: SQL Server | Tips | Development

12 Comments
Actions: E-mail | Permalink | Comment RSSRSS comment feed

Enough of the Indian “Resilience”

I’m sitting here with mixed feelings. One is a sense of happiness and achievement of having bought a home. The second however is of extreme anger, sadness and helplessness. India’s just seen one of the most brazen terror attacks in history. In terms of absolute numbers, there have been times when the number of lives lost in single terror attacks have been greater. However, this was the most audacious such attack – openly walking in to famous stops across one of India’s biggest cities and causing havoc.

I’m not going to start analyzing what could have been done and how stupid the politicians are and how brave the men in uniform are. Facts of life. These are some of the things I plan to do. Maybe you’ll find some stuff in these that you might like to do as well.

  • I do NOT want to light lamps, candles, prayer sticks for the terror victims, commandos, their families or whoever – unless they are in a critical orifice of a terrorist. Holding rallies, arm bands etc. is good enough to show anger at the government. But let’s be clear – showing the guys massacring innocents paper banners with “peace” on it is only probably get that paper stuffed in you along with some lead.
  • I do NOT want to pay taxes + surcharges + cess + god-knows-what-else to the government when they can’t try (forget guarantee) to provide safety to my family and friends. I don’t mind paying even a little more taxes if the security forces are given adequate trainings and equipment. It was pathetic to see the Mumbai police standing on the Gateway of India before the NSG turned up with scope-less .303 rifles. Were they meant to be snipers? I doubt they could even hit a crow that landed next to them with that obsolete piece of junk. But no, the government wants to take my hard earned money and give it their vote banks in the name of caste, religion, region and gender!
  • I WANT to be involved in more proactive citizen strategies to avoid such situations again. Being part of a neighborhood watch, weapons training in localities, etc.
  • I WANT to instill a feeling pride, love and responsibility of the country in my son and I wish everyone else has that too. Which means that I want that there be compulsory military service for all youth.
  • I WILL slap anyone talking about the great Indian resilience. Indian resilience is nothing but talking “intellectually” over glasses of whiskey while watching the news or in parties. 10 days later most people are going to be back watching the stupid, mindless, and endless soaps on the same TV.
  • I WILL back a strong government. We need to show the world that anyone who looks at India with malicious thoughts that we will take them to task. I want them to hang Afzal TODAY! and if the government gives an excuse of law and order – well, it’s their frigging JOB to make sure we’re safe.
  • I do NOT want to apply “Gandhigiri” and peace and love to the terrorists while showing them the other cheek. Gandhi never had to face this sort of fanaticism – remember, he was the one against the establishment, albeit in a peaceful manner.
  • I will NEVER, ever vote for Insensitive louts masquerading as “leaders” (like RR & Shivraj Patil, Deshmukh, Naqvi, Achunanthan and others) and make sure that their own as well as their family’s political careers are completely over.
  • I do NOT have any respect for so-called “intellectuals” like the Roys, Setvlads (any relation to Vlad the Impaler?) who spout nonsense when brave soldiers and policemen get killed and accuse them instead of having killed “innocent” terrorists. My appeal to the establishment is that if next time an event like this occurs, please get Roy and Setvlad and send them in to the innocents holding the AK47s to replace the hostages. After all, the poor, innocent youth-with-grenades are not going to harm them, are they?
  • And finally, I will NOT bow my head before any religious deity EVER. I don’t care what kind of moronic reason people will give justifying “God”’s inaction. If anything, if this creature called God actually exists, it is even more despicable than the politicians of our country for seeing so many innocents being killed – and I don’t mean only in the Mumbai attacks but over the countless centuries of bloodshed that humans have done in it’s name. If there is such a creature, it sure does have a frigging thick hide to bear the disgusting acts done in its name.

There are a bunch of other things I’d like to do and say, but they’re not something that I’d want to write down. All in all, 26/11 is only ONE such event – India has faced far too many such incidents to start moving on yet again! You need to show your ANGER – not your RESILIENCE.


Tags: , ,
Categories: Personal

2 Comments
Actions: E-mail | Permalink | Comment RSSRSS comment feed

Moving into a new house

Finally, after years of trying to buy a house and meeting with challenges and almost got it instances, we’ve done it. We’ve managed to purchase an apartment in Sector 47, Gurgaon and move in there over the weekend. Here are some of the high- and low- lights of the transition as well as some pointers for those planning to purchase a house.

  • It took us 3 years of searching, negotiating, fights and sleepless nights off and on to buy a house in Gurgaon.
  • For all those media people who claim property prices are falling, they’ve got their heads in the clouds - prices in Gurgaon are atrocious.
  • The apartment at a total built-up area of 2615 sq.ft. and covered area of 2365 sq.ft. is large compared to the most of the other apartments at the budget we had. Fairly well planned out other than the placement of structural beams and columns.
  • We had to spend a huge amount of money more to get all the woodwork, electrical fittings, plumbing and painting done. Never trust the builder’s work in any of this.
  • Make sure you apply for a home loan well in advance. The more the documentation you can provide, the faster the loan can get processed. Have scanned copies of anything and everything you can think of.
  • Woodwork takes x*1.5 days at least where x is the number of days promised to you by the carpenter.

Anyway, I’ll put up some shots of the house soon. We’re still living out of boxes for this week while some plumbing and electricity stuff gets done.


Tags: , ,
Categories: Personal

4 Comments
Actions: E-mail | Permalink | Comment RSSRSS comment feed