Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 83
  • Last Modified:

Best SQL Server DataType

What is the best data type for time-of-day?  Ex: "15:26:58.250"

Thanks!
0
Bob Schneider
Asked:
Bob Schneider
2 Solutions
 
SimonCommented:
I'd say TIME unless you need timezone awareness.
0
 
Phillip BurtonCommented:
If you only need 2 decimal places, then smalldatetime uses 4 bytes, whereas Time uses 5.

However, you would need to insert a date as well (even a dummy date).

Both of these can be used from SQL Server 2008 onwards.
0
 
Bob SchneiderAuthor Commented:
I do need three decimal places and I don't want to insert a dummy date but this has been helpful and enlightening.

Thank you both!
0

Featured Post

Learn Veeam advantages over legacy backup

Every day, more and more legacy backup customers switch to Veeam. Technologies designed for the client-server era cannot restore any IT service running in the hybrid cloud within seconds. Learn top Veeam advantages over legacy backup and get Veeam for the price of your renewal

Tackle projects and never again get stuck behind a technical roadblock.
Join Now