Collections:
Out-of-Range DATETIME Values in SQL Server Transact-SQL
What Are Out-of-Range Errors with DATETIME values in SQL Server Transact-SQL?
✍: FYIcenter.com
When you enter DATETIME values, you may get out-of-range errors due to two common mistakes:
The tutorial exercise below shows you some data and time out-of-range errors:
-- Invalid date DECLARE @x DATETIME; SET @x = '30-Feb-2017 22:55:07.233'; ----------------------------------- Msg 242, Level 16, State 3, Line 2 The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value. -- Date below the DATETIME limits DECLARE @x DATETIME; SET @x = '19-May-1752 22:55:07.233'; ----------------------------------- Msg 242, Level 16, State 3, Line 2 The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value. -- Invalid time DECLARE @x DATETIME; SET @x = '19-May-2017 24:55:07.233'; ----------------------------------- Msg 242, Level 16, State 3, Line 2 The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value.
⇒ Single-Byte Character Data Types in SQL Server Transact-SQL
⇐ Time-Only DATETIME Values in SQL Server Transact-SQL
2017-04-08, 11581🔥, 0💬
Popular Posts:
How To Use "IF ... ELSE IF ..." Statement Structures in SQL Server Transact-SQL? "IF ... ELSE IF ......
How To Create a Table Index in Oracle? If you have a table with a lots of rows, and you know that on...
How To Use GO Command in "sqlcmd" in SQL Server? "sqlcmd" is a command line client application to ru...
How to download and install Microsoft .NET Framework Version 2.0 in SQL Server? .NET Framework Versi...
What is dba.FYIcenter.com Website about? dba.FYIcenter.com is a Website for DBAs (database administr...