Why doesn't SQL Server have a clean date and clean time?

I have several SQL Server tables with a datetime field that really should only contain dates ... and the fact that the datetime object violates data integrity, because it can be inserted with a time that isn’t really valid for that field. As a result, we must convert it and turn off the time every time we use it. We considered adding triggers to make sure that no data could even get with the time tied ... but it seems to me that this really should be part of the database software and should not be specially programmed every time.

Why doesn't SQL Server have separate date and time data types? Will this change in the near future? Are there other database platforms?

+4
source share
2 answers

SQL Server 2008 has DATE and TIME data types.

Which version are you using?

+4
source

SQL Server has a clean date and time data type since version 2008, they also added a bunch of new datetime types, now it also completely goes back to year 1 instead of 1753

+2
source

Source: https://habr.com/ru/post/1312453/


All Articles