If you're using Microsoft SQL Server 2012 or later, use
TRY_PARSE[
^]:
UPDATE Website_Tracker
SET StartTime1 = TRY_PARSE(StartTime As datetime USING 'en-US')
You should also consider using the
datetime2[
^] data type, rather than the older
datetime
type.
datetime
requires 8 bytes, and only supports dates from 1753 onwards.
datetime2(0)
would only use 6 bytes, and supports the same range of dates as the .NET
DateTime
type.
UPDATE Website_Tracker
SET StartTime1 = TRY_PARSE(StartTime As datetime2(0) USING 'en-US')
If you're using a different DBMS, or a version of SQL Server earlier than 2012, then you'll need to tell us what you're using. :)