What is the unit of the Duration column in SQL Profiler? I thought it was milliseconds but in the following Profiler row I found it contradicting with start and end time:
spid=163 duration=11310646 starttime=2010-04-06 17:45:24.480 endtime=2010-04-06 17:45:35.790 reads=152 writes=2 cpu=16 eventclass=12 textdata= DELETE FROM dbo.[Icon] WHERE Id = 20087
FYI, I am using SQL Server 2008.
The SQL Server Profiler graphical user interface displays the Duration column in milliseconds by default, but when a trace is saved to either a file or a database table, the Duration column value is written in microseconds.
A duration is a positive or negative number representing an interval of time. Labeled durations The form a labeled duration is as follows: function-invocation 1 ( expression ) constant column-name variable YEAR YEARS MONTH MONTHS DAY DAYS HOUR HOURS MINUTE MINUTES SECOND SECONDS MICROSECOND MICROSECONDS.
SQL Server Profiler is an interface to create and manage traces and analyze and replay trace results. Events are saved in a trace file that can later be analyzed or used to replay a specific series of steps when diagnosing a problem. SQL Trace and SQL Server Profiler are deprecated. The Microsoft. SqlServer.
On the Events Selection tab, click Organize Columns. In the Organize Columns dialog box, select one column by which you want to group and aggregate the displayed trace events. Click Up to move the column name under Groups. You can use the Up and Down buttons to rearrange the remaining columns under Columns if needed.
According to the documentation (for SQL Server Profiler 2016) the default unit for the Duration column is milliseconds. Show values in Duration column in microseconds Displays the values in microseconds in the Duration data column of traces. By default, the Duration column displays values in milliseconds.
SQL Profiler CPU / duration units. Beginning with SQL Server 2005, the server reports the duration of an event in microseconds (one millionth, or 10 -6 of a second) and the amount of CPU time used by the event in milliseconds (one thousandth, or 10 -3 of a second). In SQL Server 2000, the server reported both duration and CPU time in milliseconds.
Even in SQL Server 2000, the server reported both duration and CPU time in milliseconds. In SQL Server 2005 and later, the SQL Server Profiler graphical user interface displays the Duration column in milliseconds by default, but when a trace is saved to either a file or a database table, the Duration column value is written in microseconds.
I found in SQL Server 2017, that duration showed as milliseconds in the Profiler view, but when I exported to a table it showed in microseconds. A bit confusing at first. Thanks for contributing an answer to Stack Overflow!
I found the answer here. It says
In SQL Server 2005 and later, the SQL Server Profiler graphical user interface displays the Duration column in milliseconds by default, but when a trace is saved to either a file or a database table, the Duration column value is written in microseconds
I was watching them after saving the trace file in database.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With