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/redfox241/archive/2007/10/17/927410.html