I need to convert a string to datetime. I need to store datetime with milliseconds in SQL Server 2005.
example:
SELECT CAST('2010-07-28 20:07:25.733000000' AS DATETIME)
when I try I am getting error like
Conversion failed when converting datetime from character string
datetimerather thandatetime2, you ought to replace the space between the date and time with the letterT. E.g.'2010-07-28T20:07:25.733'- otherwise, the conversion may fail if different language settings are in force.