Wednesday, March 21, 2012

primary key in the network

Hi,

My database has a table. This table has a column ( named : No.) set to be a primary key, and it's ( identity). When several people access the database in the same time and add some data, some of them will see this error message : ( column (No.) doesn't allow repeated values) How can I solve this problem?

Thanks.

Hi,

My database has a table. This table has a column ( named : No.) set to be a primary key, and it's ( identity). When several people access the database in the same time and add some data, some of them will see this error message : ( column (No.) doesn't allow repeated values) How can I solve this problem?

Thanks a lot.

|||

Are you inserting explicit values for the identity column, or letting SQL Server autonumber them for you?

Thanks,

John

|||

SQL Server autonumber them for me.

one more easy question:

What's the kind of the network SQL server works with? Is it peer to peer ( workgroup ) or server (domain ) network?

thanks

|||

I am still unsure what is going on in your first problem, if you could provide a code sample or more information it would help a lot. As for your second question, what do you mean by what kind of network does it work with? Are you asking about windows authentication for SQL Server? The architecture is client server, not p2p but I am unsure why you have broken these two communication archetypes into workgroup/domain groupings so I am not sure how to answer that question.

Thanks,

John

|||The identity column is maintained by SQL Server only, until you specify the Identity Insert to ON, to insert values for yourself. My next step if I were you would be to sniff the commands that are executed against the database using SQL Server profiler. I guess that the error message either comes from anothert column having A UNIQUE constraint build upon it or someone uses the IDENTITY INSERT command to insert values manually.

Jens K. Suessmeyer.

http://www.sqlserver2005.de
--sql

No comments:

Post a Comment