Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 

Get your favorite SSC scripts directly in SSMS with the free SQL Scripts addin. Search for scripts directly from SSMS, and instantly access any saved scripts in your SSC briefcase from the favorites tab.
Download now (direct download link)

Simple function to return time from datetime value

By Neil Jacobson,

Since SQL Server stores time as a full datetime value, I use this script to return just the time part formatted as hh:mm:ss.

Usage:
Select mydb.dbo.udfHHMMSS(Getdate())

Total article views: 892 | Views in the last 30 days: 1
 
Tags
miscellaneous    
t-sql    
 
Contribute