I am using SQL Server 2005 Express Edition. I want to store date of birth in a table, which datatype should I use for that?
Datetime
provides time also with the date.
Is there any way in SQL Server 2005 to store only date?
I am using SQL Server 2005 Express Edition. I want to store date of birth in a table, which datatype should I use for that?
Datetime
provides time also with the date.
Is there any way in SQL Server 2005 to store only date?
Use smalldatetime (4 bytes storage) and add a check constraint. Do not use char or such.
The CHECK CONSTRAINT would be this, based on this question Best approach to remove time part of datetime in SQL Server
DOBCol = DATEADD(day, DATEDIFF(day, 0, DOBCol), 0)