473,405 Members | 2,279 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,405 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 2777
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.