473,385 Members | 1,766 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Replication

Hi,

I am setting up transactional replication and have run into a problem… Can anyone help?

The table I am publishing is called Area. The table, Area, is the same on both the publisher and the subscriber.

When executing transactional replication, the error I get from the distribution agent is:-

Cannot update identity column 'AreaId'.

Cannot update identity column 'AreaId'.
(Source: WTEVAL01\REPORTING (Data source); Error number: 8102)

This is the SQL for the table ‘Area’:-

Expand|Select|Wrap|Line Numbers
  1. CREATE TABLE [Area] (
  2.     [AreaId] [int] IDENTITY (1, 1)   NOT NULL ,
  3.     [AreaCode] [varchar] (6) COLLATE Latin1_General_CI_AS NOT NULL ,
  4.     [Description] [varchar] (30) COLLATE Latin1_General_CI_AS NOT NULL ,
  5.     [ParentAreaId] [int] NULL ,
  6.     [Priority] [int] NULL ,
  7.     [Visible] [bit] NOT NULL CONSTRAINT [DF_Area_Visible] DEFAULT (1),
  8.     [indent] [varchar] (5) COLLATE Latin1_General_CI_AS NULL ,
  9.     [CreateDate] [datetime] NOT NULL ,
  10.     [ModifyDate] [datetime] NOT NULL ,
  11.     [DisplayOrder] [int] NULL ,
  12.  
  13.  
  14.  
  15.  
  16.     CONSTRAINT [PK_Area] PRIMARY KEY  NONCLUSTERED 
  17.     (
  18.         [AreaId]
  19.     ) WITH  FILLFACTOR = 90  ON [PRIMARY] ,
  20.     CONSTRAINT [U_Area_Code] UNIQUE  NONCLUSTERED 
  21.     (
  22.         [AreaCode]
  23.     ) WITH  FILLFACTOR = 90  ON [PRIMARY] ,
  24.     CONSTRAINT [FK_Area_ParentArea] FOREIGN KEY 
  25.     (
  26.         [ParentAreaId]
  27.     ) REFERENCES [Area] (
  28.         [AreaId]
  29.     )
  30. ) ON [PRIMARY]
  31. GO

I’ve managed to work out from reading a few sites that the constraint PK_Area is being violated so I must disable this constraint for replication.

However, I have read that primary keys, unique keys or indexes cannot be disabled.

The only alternative I can think of is to drop the constraint PK_Area, but the subscriber server is a live production server and is constantly hit with queries therefore I’ve been told that re-building the index constraint PK_Area after each replication run (which is every 10 mins) is unacceptable.

How can I get round this?

Kind Regards,
Tom
Nov 27 '06 #1
1 2771
Borik
1
You need to use "NOT FOR Replication" in your identity column...


Hi,

I am setting up transactional replication and have run into a problem… Can anyone help?

The table I am publishing is called Area. The table, Area, is the same on both the publisher and the subscriber.

When executing transactional replication, the error I get from the distribution agent is:-

Cannot update identity column 'AreaId'.

Cannot update identity column 'AreaId'.
(Source: WTEVAL01\REPORTING (Data source); Error number: 8102)

This is the SQL for the table ‘Area’:-

Expand|Select|Wrap|Line Numbers
  1. CREATE TABLE [Area] (
  2.     [AreaId] [int] IDENTITY (1, 1)   NOT NULL ,
  3.     [AreaCode] [varchar] (6) COLLATE Latin1_General_CI_AS NOT NULL ,
  4.     [Description] [varchar] (30) COLLATE Latin1_General_CI_AS NOT NULL ,
  5.     [ParentAreaId] [int] NULL ,
  6.     [Priority] [int] NULL ,
  7.     [Visible] [bit] NOT NULL CONSTRAINT [DF_Area_Visible] DEFAULT (1),
  8.     [indent] [varchar] (5) COLLATE Latin1_General_CI_AS NULL ,
  9.     [CreateDate] [datetime] NOT NULL ,
  10.     [ModifyDate] [datetime] NOT NULL ,
  11.     [DisplayOrder] [int] NULL ,
  12.  
  13.  
  14.  
  15.  
  16.     CONSTRAINT [PK_Area] PRIMARY KEY  NONCLUSTERED 
  17.     (
  18.         [AreaId]
  19.     ) WITH  FILLFACTOR = 90  ON [PRIMARY] ,
  20.     CONSTRAINT [U_Area_Code] UNIQUE  NONCLUSTERED 
  21.     (
  22.         [AreaCode]
  23.     ) WITH  FILLFACTOR = 90  ON [PRIMARY] ,
  24.     CONSTRAINT [FK_Area_ParentArea] FOREIGN KEY 
  25.     (
  26.         [ParentAreaId]
  27.     ) REFERENCES [Area] (
  28.         [AreaId]
  29.     )
  30. ) ON [PRIMARY]
  31. GO

I’ve managed to work out from reading a few sites that the constraint PK_Area is being violated so I must disable this constraint for replication.

However, I have read that primary keys, unique keys or indexes cannot be disabled.

The only alternative I can think of is to drop the constraint PK_Area, but the subscriber server is a live production server and is constantly hit with queries therefore I’ve been told that re-building the index constraint PK_Area after each replication run (which is every 10 mins) is unacceptable.

How can I get round this?

Kind Regards,
Tom
Feb 26 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Cherrish Vaidiyan | last post by:
Frank <fbortel@nescape.net> wrote in message news:<bqgb99$a04$1@news1.tilbu1.nb.home.nl>... > Cherrish Vaidiyan wrote: > > Hello, > > > > I have certain doubts regarding replication of Oracle 9i ...
6
by: John | last post by:
Hi We have an access app (front-end+backend) running on the company network. I am trying to setup replication for laptop users who go into field and need the data synched between their laptops...
56
by: Raphi | last post by:
Hi, I've been using an Access application I wrote for an office with the front-end stored on all computers and the back-end on one of them serving as an Access file server. Now we're moving...
9
by: David W. Fenton | last post by:
See: Updated version of the Microsoft Jet 4.0 Service Pack 8 replication files is available in the Download Center http://support.microsoft.com/?scid=kb;en-us;321076 This includes the Jet 4...
3
by: Gert van der Kooij | last post by:
Hi, Our SQL Replication is between DB2 databases on Windows servers. I'm searching for the document which tells me how to migrate our SQL Replication environment from V8 to V9 (we also need to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.