Question

Context: SQL Server 2012, Windows Server 2008 R2 (64bit), 2 cores, lots of RAM and HD space, ADODB via JScript (not .NET)

These really simple stored procedures keep timing out. It's not like I have a lot of records either (from a server point of view): 100,000 or so.

CREATE PROCEDURE [dbo].[Transfer_Part1]
AS
    SET NOCOUNT ON
    INSERT INTO Primary.dbo.Post
    SELECT *
    FROM Secondary.dbo.Pre
    WHERE HrefProcessed = (-1)
        AND ReferrerProcessed = (-1);

CREATE PROCEDURE [dbo].[Transfer_Part3]
AS
    SET NOCOUNT ON
    DELETE
    FROM Secondary.dbo.Pre
    WHERE HrefProcessed = (-1)
        AND ReferrerProcessed = (-1);

Is there anything I can do to stop getting these messages?

[Microsoft][ODBC SQL Server Driver]Query timeout expired
EXEC Transfer_Part1
[Microsoft][ODBC SQL Server Driver]Query timeout expired
EXEC Transfer_Part3
Was it helpful?

Solution

Do you have an 2-column index on HrefProcessed and ReferrerProcessed?

Also see Bulk DELETE on SQL Server 2008 (Is there anything like Bulk Copy (bcp) for delete data?) for the second one.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top