CREATE TABLE ManyRecords
(
idManyRecords integer IDENTITY,
idFKtoOtherTable integer NOT NULL,
nDuration integer NOT NULL,
nCost decimal(16,4) NOT NULL DEFAULT 0,
nAdjustedCost decimal(16,4) NOT NULL,
szLocation varchar(24) NOT NULL,
szDigits varchar(24) NOT NULL
)
ALTER TABLE ManyRecords ADD
CONSTRAINT PK_ManyRecords
PRIMARY KEY CLUSTERED (idManyRecords)
go
Indeed, a NOLOCK query does take out Sch-S locks. I don't know if that
could be the reason for this failure. In such case the error message is
misleading.
Rather than using NOLOCK, have you considered using snapshot isolation
or read committed snapshot?
--
Erland Sommarskog, SQL Server MVP, esq...@sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx