SQL – Best data type for storing data and time


This Content is from Stack Overflow. Question asked by fightstarr20

I am building an SQL database for some existing data and am looking for some pointers on data types for storing dates.

The data I have looks like this…

2022-09-19 00:00:00.0000000
2022-09-19 00:00:00.0000000
2022-09-19 00:00:00.0000000

And for the data type I have gone with smalldatetime

Is this the best for storing this sort of data and does anybody see any disadvantages of storing it using this data type?


This question is not yet answered, be the first one who answer using the comment. Later the confirmed answer will be published as the solution.

This Question and Answer are collected from stackoverflow and tested by JTuto community, is licensed under the terms of CC BY-SA 2.5. - CC BY-SA 3.0. - CC BY-SA 4.0.

people found this article helpful. What about you?