473,396 Members | 2,029 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,396 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 2776
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: 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
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: 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
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
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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...

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.