문제

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
도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top