Solved

Best SQL Server DataType

Posted on 2015-02-12
3
70 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
sql query help 15 50
Using this function 4 38
In SQL 2000 combine mulitple rows into a single row seperated by a semi colon 10 40
Rebooting Witness SQL Server 2 23
Introduction In my previous article (http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/SSIS/A_9150-Loading-XML-Using-SSIS.html) I showed you how the XML Source component can be used to load XML files into a SQL Server database, us…
Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.

685 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