Showing posts with label cause. Show all posts
Showing posts with label cause. Show all posts

Thursday, March 29, 2012

Error: duplicate key row

What might cause the following error when inserting rows in tables that have primary keys defined as IDENTITY (1,1)?

duplicate key row in object 'aa' with unique index 'aa'

I have seen this happen frequently when data has been bulk loaded sometime in the past into a table that has an IDENTITY key. This is especially common when you have a test environment in which some production data was bulk loaded to give some "good test data." To me it means that an identity number has "already been used" as a record key.


Dave

|||The rows are inserted one at a time using the parent IDENTITY key as a FK constraint in the child table which also has an IDENTITY KEY. However, this scenario does not sound like it would cause an error.|||

Can you post the table structures? That would help us to see what your problem might be.

If you can post a few statements that cause the duplicates, that would even be better.

|||

If you have the property NOT FOR REPLICATION enabled for the identity column.

Merging changes would allow the exact id values to be inserted rather than a new value that would give the error if same id value exists in the participating server.

similarly, if you are trying to insert manually using SET IDENTITY_INSERT table ON...

Wednesday, February 15, 2012

Error while connection

Hi I want to connect with Magic 9.4 to the northwind table.

I get always this error:

Error during the registration user SA. A cause: No familiar SQL server
connection assigned.

How can I create a trusted server connection ?

Thanks.

Volker"Volker Pieper - Rayman" <rayman@.idepro.d> wrote in message news:<bvmbk0$b5d$1@.online.de>...
> Hi I want to connect with Magic 9.4 to the northwind table.
> I get always this error:
> Error during the registration user SA. A cause: No familiar SQL server
> connection assigned.
> How can I create a trusted server connection ?
> Thanks.
> Volker

To make a trusted connection (and assuming you're using SQL 2000),
then you need to grant server access to the Windows account you're
using to connect, as well as the necessary database access. You can
use Enterprise Manager, or see sp_grantlogin and sp_grantdbaccess in
Books Online.

After that, you have to tell your client application to use a trusted
connection instead of a SQL login/password. That depends on which
client library you're using, so you would need to check your Magic
documentation on that.

Simon