Solved

Best SQL Server DataType

Posted on 2015-02-12
3
68 Views
Last Modified: 2015-02-12
What is the best data type for time-of-day?  Ex: "15:26:58.250"

Thanks!
0
Comment
Question by:Bob Schneider
3 Comments
 
LVL 18

Accepted Solution

by:
Simon earned 250 total points
ID: 40605426
I'd say TIME unless you need timezone awareness.
0
 
LVL 24

Assisted Solution

by:Phillip Burton
Phillip Burton earned 250 total points
ID: 40605429
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
 

Author Comment

by:Bob Schneider
ID: 40605440
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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
I have a large data set and a SSIS package. How can I load this file in multi threading?
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question