Inserting C# datetime milliseconds into sql Server DateTime

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: tk042383 (tkirkman_at_edisoncarter.com)
Date: 05/04/04


Date: Mon, 03 May 2004 20:18:01 -0400

On a C# datetime value I am using ToString(format) to specify a format of
"d/M/yyyy H:mm:ss:ffff" in trying to insert the value including its
milliseconds precision into a sqlServer 2000 DateTime column. I get error
241: "Syntax error converting to datetime from character string".

How do I insert the datetime value into a DateTime column so that it will
include the milliseconds component?



Relevant Pages

  • Re: ids 10 datetime migrate error
    ... the datetime column is not null ... Create table x(log_date datetime year to second not null) ... ids: 10.00.FC3R1 server name: on17tcp ...
    (comp.databases.informix)
  • Re: extracting date from datetime execution performance time problem
    ... I need to take date value from datetime column. ... If your issue is to have the query return dates in the 103 format (dd- ... results in an application that offers formatting (an ASP/ASP.Net ...
    (microsoft.public.sqlserver)
  • Remove Seconds from Datetime: How To?
    ... I want to create some volume metrics, and I need to produce a report ... truncate the seconds from the datetime. ... datetime column, re-assemble them with the stupid ...
    (comp.databases.ms-sqlserver)
  • Re: Remove Seconds from Datetime: How To?
    ... Cast(INSERT_DT As Smalldatetime) ... truncate the seconds from the datetime. ... It seems very strange to pull the components out of the original ... datetime column, re-assemble them with the stupid ...
    (comp.databases.ms-sqlserver)
  • Re: Remove Seconds from Datetime: How To?
    ... truncate the seconds from the datetime. ... It seems very strange to pull the components out of the original ... datetime column, re-assemble them with the stupid ...
    (comp.databases.ms-sqlserver)