How SQL Server Views the Execution Time of SQL Statements
The following is the source code sky of a relatively simple query SQL statement execution time method in SQL Server, which is calculated by the time difference
between the time before the query and the time after the query : declare @begin_date datetime declare @end_date datetime select @begin_date = getdate() select @ end_date = getdate() select datediff(ms,@begin_date,@end_date) as 'time/ millisecond ' 2: The following method is more comprehensive, returning the steps taken when executing each statement as a rowset, through the hierarchy tree Show it in the form set statistics profile on set statistics io on set statistics time ongo <Write your statement here...go set statistics profile off