Index name changes in Transactional replication on SQL Server 2000

  • Hi,

    In our company we run multiple SQL Server 2000 instances in a clustered environment that replicate to two other standalone instances at different sites.

    We use transactional replication and are running all instances on SQL Server 2000 SP4 on Windows 2003 SP1.

    The problem is that in the replication-destinationdatabases the primary key index name changes from 'PK_KEYNAME' to 'MSCCSPK_20051208213220184'.

    Some of our queries that are not Stored Procedures and these queries reference the name of the indexes.

    Is there some kind of setting to make sure the index name stays the same as in the publishing-database?

    Thanks in adance.

    Michiel

     

     

     

     

  • Several things need to be commented regarding your question:

    1. Question: Are you creating the schema on the target servers yourself, or are you letting the publisher create the schema on the subscribers?

    2. Question: Check out the schema_option that you are using for the article. One of the parameters in the schema_option will direct replication to replicate the article keys. Can you please post the value of the schema_option you're using?

    3. It is not a good practice to hard-code against the primary key name. You can get the name of the primary key in run-time instead.

    Please elaborate on (1) and (2).

    -----------------

    Omri Bahat

    SQL Farms Solutions

    http://www.sqlfarms.com

    Editor's Note: : Dr. Omri Bahat works for SQLFarms, a software vendor of SQL Server tools.

  • 1. I'm letting the publisher create the schema on the subscribers.

    2. In the sysarticles-table the value of schema_option is 0x00000000000000F3 on the row that correspondents with a table where the problem occurs. Is that what you mean?

    3. I know but at the moment, there's no option to recode the tool and all the queries are embedded in the sourcecode.

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

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