You can use my beta_lockinfo to investigate what is blocking what.
The way to ensure that you don't have duplicate rows in the table is by using proper primary keys. TABLOCK is a sledgehammer that is way too big for the purpose.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hi, ALL,
I am trying to run the following query thru SQLPrepare/SQLBind/SQLExecute sequence:
INSERT INTO abcattbl WITH( TABLOCK ) SELECT ?, ?, (SELECT object_id FROM sys.objects o, sys.schemas s WHERE s.schema_id = o.schema_id AND o.name = ? AND s.name = ?), '', 8, 400, 'N', 0, 0, 34, 0, 'MS Sans Serif', 8, 400, 'N', 0, 0, 34, 0, 'MS Sans Serif', 8, 400, 'N', 0, 0, 34, 0, 'MS Sans Serif', '' WHERE NOT EXISTS(SELECT * FROM dbo.abcattbl WHERE abt_tnam=? AND abt_ownr=?);
However trying to do SQLExecute the table becomes locked and the code runs indefinitely.
What am I doing wrong?
I'm trying to make sure there is only 1 record present in the table,
Thank you.
You can use my beta_lockinfo to investigate what is blocking what.
The way to ensure that you don't have duplicate rows in the table is by using proper primary keys. TABLOCK is a sledgehammer that is way too big for the purpose.