Quantcast
Channel: Conversion failed when converting date and/or time from character string
Viewing all articles
Browse latest Browse all 16

Conversion failed when converting date and/or time from character string

$
0
0

How can you insert sql_variant data type value to your datetime column?

You query fools you without an error by using sql_variant type due to the same type.

But it does not work to insert the value to your target datetime column directly.  You still need to convert back from sql_variant to datetime using convert/cast in a separate step in order to insert your data.

If you have invalid date, you will run into same problem again.



Viewing all articles
Browse latest Browse all 16

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>