We are going to be installing AS Enterprise in home office and AS Anywhere in the field. We would like to use an autoincrement key on some tables. Is there a good way to avoid duplicate keys. Also, are there any pitfalls to using the two different servers for replication. TIA Fred.
You cannot take advantage of the special IDENTITY data type when creating a replication definition with an ASA db as the subscriber. If you try this, replication of inserts from ASE to ASA will fail, because the rep server will try to issue a "set identity_insert tablename on" command to the ASA (This is how v11.0.2 of rep server works). This is an invalid command to ASA. The workaround is to define the identity column as type "numeric" in the replication definition for the ASE table. ASA will accept inserts using this form of the repdef.
I don't think you should ever use "identity" or "autoincrement" defaults when replicating. To avoid duplicate primary key problems you should be using primary key pools. Save the pain retro-fitting now and design it with replication in mind. See the Help file: Data Replication with SQL Remote PART 2. Replication Design for SQL Remote CHAPTER 7. SQL Remote Design for Adaptive Server Anywhere Ensuring unique primary keys Primary key pool summary -- David Fishburn Sybase Please only post to the newsgroup Tom Iarusso wrote in message <374C20A0.5D36@nu.com>... >You cannot take advantage of the special IDENTITY data type when >creating a replication definition with an ASA db as the subscriber. If >you try this, replication of inserts from ASE to ASA will fail, because >the rep server will try to issue a "set identity_insert tablename on" >command to the ASA (This is how v11.0.2 of rep server works). This is >an invalid command to ASA. > >The workaround is to define the identity column as type "numeric" in the >replication definition for the ASE table. ASA will accept inserts using >this form of the repdef.
Take a look at: --------------------------------------------------------------- Data Replication with SQL Remote PART 2. Replication Design for SQL Remote CHAPTER 7. SQL Remote Design for Adaptive Server Anywhere Ensuring unique primary keys -------------------------------------------------------------------- The same concepts apply to ASE as apply to ASA. -- --------------------------------------- Rob Waywell Sybase Please Respond to Newsgroups fdefranco wrote in message ... >We are going to be installing AS Enterprise in home office and AS Anywhere >in the field. We would like to use an autoincrement key on some tables. Is >there a good way to avoid duplicate keys. Also, are there any pitfalls to >using the two different servers for replication. > >TIA > >Fred. > >