|
Posted by David Portas on 10/02/34 11:45
Larry Bertolini wrote:
> For some reason, I recall having read that SQL Server 2005 would support
> a datatype that represented date, but not time. (This would be useful
> for storing things like birthday, where you usually don't care about the
> time of day). But I've got SQL Server 2005 installed, and there's no
> such datatype to be found.
>
> Is this something that might be released in a Service Pack, or is it
> just not going to happen?
DATE never made it to RTM. It's not in SP1 either.
Instead try:
CREATE TABLE tbl
(dt SMALLDATETIME NOT NULL CHECK
(DATEADD(DAY,DATEDIFF(DAY,0,dt),0)=dt), ...)
--
David Portas, SQL Server MVP
Whenever possible please post enough code to reproduce your problem.
Including CREATE TABLE and INSERT statements usually helps.
State what version of SQL Server you are using and specify the content
of any error messages.
SQL Server Books Online:
http://msdn2.microsoft.com/library/ms130214(en-US,SQL.90).aspx
--
Navigation:
[Reply to this message]
|