sql 脚本执行时间

SET STATISTICS PROFILE ON; 
SET STATISTICS IO ON; 
SET STATISTICS TIME ON; 
GO 
/*--你的SQL脚本开始*/
SELECT l2.num,l1.*
    FROM uvTaskList l1 ,
        ( SELECT WS_ID ,
                ROW_NUMBER() OVER ( ORDER BY WS_ID DESC ) AS num
            FROM uvTaskList
            WHERE ALLOWED_OPERATOR_CAL LIKE '%118%'
        ) l2
    WHERE l1.WS_ID = l2.WS_ID
        AND l2.num BETWEEN 61 AND 70;
GO 
/*--你的SQL脚本结束*/
SET STATISTICS PROFILE OFF; 
SET STATISTICS IO OFF; 
SET STATISTICS TIME OFF;
DECLARE @d DATETIME;
SET @d = GETDATE();
/*你的SQL脚本开始*/
SELECT l2.num,l1.*
    FROM uvTaskList l1 ,
        ( SELECT WS_ID,ROW_NUMBER () OVER (ORDER BY WS_ID DESC) AS num FROM uvTaskList
            --WHERE ALLOWED_OPERATOR_CAL LIKE '%118%'
        ) l2
    WHERE l1.WS_ID = l2.WS_ID
        AND l2.num BETWEEN 61 AND 70;
/*你的SQL脚本结束*/
SELECT [语句执行花费时间(毫秒)] = DATEDIFF(ms,@d,GETDATE());

 

posted @ 2020-11-20 14:53  山顶洞外人  阅读(300)  评论(0编辑  收藏  举报