A primary key is a column or group of columns used to identify the uniqueness of rows in a table. Each table has one and only one primary key.
Due to the uniqueness, an attempt to insert a row (record) with an already existing primary key will fail. So you can just try inserting and report errors if necessary.
According to your transaction script,
PK_id
is the only column for the primary key and must be unique therefore. What is the purpose of the
unique_identifier
column then?
[EDIT]
To solve the error in the
SELECT
statement use
( SELECT * FROM NetworkLocks WHERE PK_id = @ID );
You may also specify columns with the table name as
NetworkLocks.PK_id
.
[/EDIT]