Sathish
Sathish

Reputation: 2066

SQL Server Management Studio: Display executed date/time on the status bar

When I execute a SQL query (e.g., SELECT 1) in SSMS, I can see the time it took to execute in the status bar. I would like to know whether it is possible to configure SSMS to show the date time the query was executed at (for example: Executed DateTime: 2015-07-28 11:15:30, not bothered about the date/time format) on status bar or in messages tab?

Here is the bar I am talking about with the section of interest enclosed in green rectangles.

enter image description here

Upvotes: 2

Views: 3524

Answers (3)

Harper
Harper

Reputation: 31

It is possible. Click on Options, click on Editor Tab and Status Bar, under Status Bar Content, for Display execution time, select End. This shows the time of day that the script completed.

This works but you won't see elapsed time unless you enable the client statistics, but that only shows after query executes. There would be no way to determine how long the query has been running.

I wish MS can have both options, elapsed and end time. Would make life so much easier.

Upvotes: 3

RSSM
RSSM

Reputation: 679

I was looking for something similar, and found that if you hit F4, you can get this info (and more) from the Properties Window.

Upvotes: 4

Steve Gray
Steve Gray

Reputation: 460

No. It is not possible. Ways around this include:

  • Do a SELECT GETDATE() at the start of the procedure.
  • Include the query statistics in the output (you'll need to dig into other tabs to see the detail though...)
  • Execute sp_who2 @spid and look for the last batch time on the job. (You may need to dig further into sys.dm_os_exec_requests)

I guess the best question I can ask is why are you looking to do this? Given that SSMS executes commands you request it do - you can just take note of the time yourself or log the start/stop time to a table.

Upvotes: 0

Related Questions