Unix Technical Forum

Data Insert Problems

This is a discussion on Data Insert Problems within the MS SQL ODBC forums, part of the Microsoft SQL Server category; --> [crossposted from sqlserver.msde] Greetings I am running a merge replication MSDE database with SP3 installed (on all computers). I ...


Go Back   Unix Technical Forum > Database Server Software > Microsoft SQL Server > MS SQL ODBC

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-27-2008, 08:33 PM
Dazed and Confused
 
Posts: n/a
Default Data Insert Problems

[crossposted from sqlserver.msde]

Greetings

I am running a merge replication MSDE database with SP3
installed (on all computers). I am having a problem
inserting new records into certain tables at the
subscriber database - not in all tables, only in specific
ones. The error message I get is:

ODBC--call failed.

[Microsoft][ODBC SQL Server Driver][SQL Server] Violation
of PRIMAY KEY constraint 'PK-XXXX'. Cannot insert
duplicate key in object 'YYYYYY'.(#2627)[Microsoft][ODBC
SQL Server Driver][SQL Server]The statement has been
terminated. (#3621)

I have checked, and my primary keys are defined
identically between the tables that work to add records,
and the tables that don't work. Furthermore, when
accessing the distributor databse, I am able to add
records to all tables without experiencing this error. It
is on the subscriber only.

Any guidance you can give would be greatly appreciated.

Thanks!


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-27-2008, 08:38 PM
Gregory Penoyer
 
Posts: n/a
Default RE: Data Insert Problems

Sounds like there is already a record in the subscriber table that
contains the same value for whichever field is defined as the Primary Key.
It is possible that the reason it works with the distributor's database is
because that field is not defined as the Primary Key. This is easily
checked using SQL Enterprise Manager. Just call up the table properties
and it will show which field is the Primary Key. It's also possible that
this field is set as such even though it doesn't need to be. If you don't
have read access to the SQL datbase, have yur distributor check the table
properties for you.
For the record, the Primary Key is used to uniquely identify each record
in the table, thus duplicates are not allowed. Sometimes, the default
setting is that the first field in the table is set as the Primary Key at
database/table creation, even when a Primary Key is not required. You
should be aware, however, that removing this tag from a field in a table
can quickly lead to ambiguity within your database and all associated
procedures and views. Make sure you investigate why it is marked as it is
prior to changing it.
--
Gregory Penoyer, Developer Division

This posting is provided "AS IS" with no warranties, and confers no rights.

Note: For the benefit of the community-at-large, all responses to this
message are best directed to the newsgroup/thread from which they
originated.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 03:38 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com