Replication on Table with Computed Columns

  • Hi All,

    I am trying to replicate a database between two servers. On the first instance I have a database which has a table with computed columns (One of the columns is the result of a scalar function). So when I tried to replicate the database, encountered the error.

    Here Evaluations is the table name and CalculateTotalScoreNEW' is the function populating one of the columns in Evaluations.

    Cannot DROP FUNCTION 'dbo.CalculateTotalScoreNEW' because it is being referenced by object 'Evaluations'. (Source: MSSQLServer, Error number: 3729)

    Get help: http://help/3729

    Cannot DROP FUNCTION 'dbo.CalculateTotalScoreNEW' because it is being referenced by object 'Evaluations'. (Source: MSSQLServer, Error number: 3729)

    Get help: http://help/3729

    Any help appreciated.

  • I believe you can avoid this by persisting the results of the function in the table.

    I *think* I've also seen this error when I was only replicating specific tables and I didn't move a function over to the replication target, but don't quote me on that... but worth a fast doublecheck.


    - Craig Farrell

    Never stop learning, even if it hurts. Ego bruises are practically mandatory as you learn unless you've never risked enough to make a mistake.

    For better assistance in answering your questions[/url] | Forum Netiquette
    For index/tuning help, follow these directions.[/url] |Tally Tables[/url]

    Twitter: @AnyWayDBA

  • above advice not of much use, some others suggestions please

    Thanks
    Gaurav

  • Don't know if you have this sorted already but...

    On each article there are properties. One is Action if name is in use. The default is to drop the object and re-create it but if the object is relied on by something else this will fail. You need to change the option to keep existing object unchanged and it will not try to drop it.

    I assume you had the object in the database before you created the subscription?

    Cheers

Viewing 4 posts - 1 through 3 (of 3 total)

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