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