Timestamp Precision

I am using ASP and SQL 2005 Express.

I am inserting a timestamp from an ASP page using <%=now%> into a
smalldatetime field. All of my timestamps are appearing without any
seconds (e.g., 1/21/2008 4:02:00 PM or 1/18/2008 11:32:00 AM).


When I view the source for my page is shows the date/time as 1/21/2008
4:27:31 PM, but for some reason the seconds will be converted to
1/21/2008 4:27:00 PM

How do i get more a more precise timestamp?

Please help.
t8ntboy [ Mo, 21 Januar 2008 22:28 ] [ ID #1913106 ]

Re: Timestamp Precision

The SMALLDATETIME data type in SQL Server is with precision to the minute,
so this is why you see the seconds trimmed off. If you want to store seconds
then you have to alter your table and change the column to DATETIME data
type.

HTH,

Plamen Ratchev
http://www.SQLStudio.com
Plamen Ratchev [ Mo, 21 Januar 2008 23:39 ] [ ID #1913109 ]
Datenbanken » comp.databases.ms-sqlserver » Timestamp Precision

Vorheriges Thema: Variables in SQL-script SQL2005
Nächstes Thema: SQL query timeout