Timeline for Conversion failed when converting date or time from character string error?
Current License: CC BY-SA 4.0
10 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Jan 8, 2019 at 16:48 | vote | accept | Ahmed Alkhteeb | ||
Jan 8, 2019 at 16:48 | answer | added | Ahmed Alkhteeb | timeline score: -2 | |
Jan 6, 2019 at 21:42 | comment | added | Aaron Bertrand |
To identify just the bad rows use WHERE dob IS NOT NULL AND TRY_CONVERT(date, <expression>) IS NULL;
|
|
Jan 6, 2019 at 7:46 | comment | added | Sabin B | If you have more than million records (no where clause in your update query), it's a good practice to do your update in a batch mode , see here : michaeljswart.com/2014/09/take-care-when-scripting-batches - here it's for delete ; the same could be for update | |
Jan 6, 2019 at 6:52 | comment | added | Ahmed Alkhteeb | @SabinBio how is that i have more than million record | |
Jan 6, 2019 at 6:29 | comment | added | Ahmed Alkhteeb | @SabinBio set dob = TRY_CONVERT(date, convert(varchar(10), 17000000 + (CIVILIDD / 100000))) is that what you mean | |
Jan 6, 2019 at 6:25 | comment | added | Sabin B |
Starting with sql server 2012, there is TRY_CONVERT (also TRY_CAST, TRY_PARSE) - it tries to convert to a specific data type , and in case of error it return NULL . Add this function in your dataset and then search for NULL learn.microsoft.com/en-us/sql/t-sql/functions/…
|
|
Jan 6, 2019 at 5:52 | history | edited | Dan Guzman | CC BY-SA 4.0 |
added 4 characters in body
|
Jan 6, 2019 at 5:45 | review | First posts | |||
Jan 6, 2019 at 15:42 | |||||
Jan 6, 2019 at 5:40 | history | asked | Ahmed Alkhteeb | CC BY-SA 4.0 |