Code
--判断sql执行所花的时间(精度为毫秒)
DECLARE @begin datetime
DECLARE @chaju bigint
DECLARE @end datetime
SET @begin=getdate()
--要执行的sql语句
SET @end=getdate()
SELECT @chaju = datediff(Millisecond, @begin, @end)
PRINT @chaju
转载于:https://www.cnblogs.com/3150379/archive/2008/10/15/1312237.html