Calculate execution time of a SQL query?

前端 未结 8 436
悲&欢浪女
悲&欢浪女 2020-12-04 14:17

I am providing search functionality in my website, when user searches a record then I want to display the time the query taken to get the results same as google does. When w

8条回答
  •  忘掉有多难
    2020-12-04 14:44

    declare @sttime  datetime
    set @sttime=getdate()
    print @sttime
    Select * from ProductMaster   
    SELECT RTRIM(CAST(DATEDIFF(MS, @sttime, GETDATE()) AS CHAR(10))) AS 'TimeTaken'    
    

提交回复
热议问题