• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 88
  • 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 BurtonDirector, Practice Manager and Computing ConsultantCommented:
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 SchneiderCo-OwnerAuthor 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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

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