I'm using SQL2008 and .NET 4.
The following UPDATE query causes timeout errors.
Table Pages has 600,000 records.
Error:
System.Data.SqlClient.SqlException (0x80131904): Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.
Query:
UPDATE Pages
SET Checked = 1 , LastChecked = GETDATE()
OUTPUT Inserted.ID, Inserted.Title INTO @Updated
WHERE ID in
(SELECT TOP (@Count) ID
FROM Pages
WHERE Checked = 0 and FileID = @FileID
ORDER BY ID)
SELECT * FROM @Updated
END
On a different thread I Insert records to Pages
table, this runs continually (a page is added every 1 sec or less).
INSERT INTO Pages (Title ,.......)
VALUES (@Title , .......)
Why do I get the timeout error and how can I solve it?
Doesn't SQL wait indefinitely on blocking situation ?