SQL Server data type for storing only time fields, for example 09:10, etc.

I want to save office startup time, etc. in my database.

The time I want to save is like 09:15 AMor 1:15PMetc.

My question is, what is the best way to save it?

I am currently using intSQL Server.

And I store data like 0915, 1605, 2305(maybe I can use some restrictions too)

Is there a better and good way to do this.

Any help is appreciated.

+5
source share
1 answer

If you are using SQL 2008 or later, you can use the TIME data type to store only time.

+8
source

All Articles