Xyz
Xyz

Reputation: 393

Insert Only Date and Only time in the table using SQL Server 2005

How to Insert Only Date and Only time in the table(column datatype is DateTime) using SQL Server 2005.

Upvotes: 1

Views: 2901

Answers (1)

Peter
Peter

Reputation: 48978

As far as I know, Date and Time are always stored together. The intern representation of it is a number, that represents timeticks that are passed since a certain moment.

You can of course filter the date info and the time info out of it and store it as for example a string.

Or you can make a userdefined type as shown here : http://weblogs.sqlteam.com/jeffs/archive/2007/10/31/sql-server-2005-date-time-only-data-types.aspx

Upvotes: 2

Related Questions