Tuesday, December 4, 2007

How to avoid getting the message Lock Time out

How to avoid getting the message Lock Time out

To avoid getting the message Lock Time out

If you have encounter the problem of record locking even through you have not tried to update the record then you can issue these select command instead.

SELECT COUNT(UserID)
FROM Users WITH (NOLOCK)
WHERE Username LIKE 'foobar'

This will ask MSSQL to ignore the lock and read directly from the table.

This will also help in designing your website to avoid your viewer from getting this message even though they just want look at your website

No comments: