Quantcast
Channel: SQL Server Database Engine forum
Viewing all articles
Browse latest Browse all 12963

Datetime issue SQL Server 2008R2

$
0
0

My server has

System Locale en-gb; English (United Kingdom)

Input Locale en-gb; English (United Kingdom)

SQL account @@language is British

I can insert the value '2013-01-18 16:05:21.683' into a DATETIME2 field but when trying to insert the same value into a DATETIME field I get the following error

Msg 242, Level 16, State 3, Line 1
The conversion of a varchar data type to a datetime data type resulted in an out-of-range value.

I can insert the value '2013-01-18T16:05:21.683' into the datetime field OK.

Why does it allow the insert into datetime2 but not datetime?

Thanks



Viewing all articles
Browse latest Browse all 12963

Trending Articles



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