Is there a way in SQL to ignore records for which a conversion failed. Setting some default value would also work.
> SELECT convert(datetime, foo_str)
> FROM foo_tbl
------------------------
Aug 23 2013 00:00:00.000
Aug 17 2013 00:00:00.000
May 06 2015 00:00:00.000
Aug 13 2013 00:00:00.000
Aug 09 2013 00:00:00.000
Sep 05 2007 00:00:00.000
May 06 2015 00:00:00.000
May 06 2015 00:00:00.000
Feb 24 2009 00:00:00.000
May 06 2015 00:00:00.000
Mar 29 2013 00:00:00.000
May 06 2015 00:00:00.000
Jul 24 2010 00:00:00.000
May 06 2015 00:00:00.000
May 06 2015 00:00:00.000
May 03 2015 00:00:00.000
Msg 249, Level 16, State 1 , Line 1 Syntax error during explicit conversion of VARCHAR value '10101' to a DATETIME field.
Can the error be avoided so that the SELECT statements comes to completion?