Replication Gotcha - Columns with Defaults

  • Comments posted to this topic are about the content posted at http://www.sqlservercentral.com/column

  • I bumped up against this problem a short while ago on a project. I eventually concluded that the problem occurs because the default constraint is given an arbitrarily assigned name on the subscriber and because that name is different to the name assigned by the publisher when you add the column, it does not know what to delete at the subscriber when you drop the column. I concluded as did you: drop the constraint at the subscriber before you drop the column at the publisher using the using the repl stored procs or EM.

     


    "See how deep the rabbit hole goes..."

  • So, to test your theory did you create default on the subscriber with the same name as on the publisher then try and drop the column?

  • Nope. Never got that far. If I was going to drop a column at the publisher, I first dropped the default constraint at the subscriber. Simple.

     


    "See how deep the rabbit hole goes..."

  • Nope. Never got that far. If I was going to drop a column at the publisher, I first dropped the default constraint at the subscriber. Simple.

     


    "See how deep the rabbit hole goes..."

  • Nope. Never got that far. If I was going to drop a column at the publisher, I first dropped the default constraint at the subscriber. Simple.

     


    "See how deep the rabbit hole goes..."

  • I ran into a similar problem when adding a column with a default to a publication.  The subscribers are all using SQLCE which I guess doesn't support default constraints so they would error out when trying to replicate the new column.  Do you know of any way to add a column with a default constraint but not replicate the default constraint?

  • Yes. Add the oclumn using the repl stored procs or EM Repl tools, but add the default contraints directly in the table editor in EM or via queyr analyser. That way the publication will not be aware of the default constraint.


    "See how deep the rabbit hole goes..."

  • Hi: Thanks for the valuable information. We have encountered another problem with transactional replication I wonder if you can help us.

    Our user got an error: "Length of text, ntext, or image data (75916) to be replicated exceeds configured maximum 65536."

    My question:

    1. How big should we set sp_configure 'max text repl size'? Do we have to worry about memory when we set it too high?

    2. How do we calculate the max text repl size from the tables we have? Some ot our tables have several image and ntext columns. Is there a formula to calculate this?

     

    Thanks in advance for your help.

    Cynthia

     

  • I know of no way to figure it out other than query every column to figure out what the largest value is. Then set the max to that or larger. Im sure it has some impact, but my guess - only a guess - is that it wouldnt be substantial, no worse than what it took to insert the value on the publisher to start with.

Viewing 10 posts - 1 through 9 (of 9 total)

You must be logged in to reply to this topic. Login to reply