On Transact SQL language the Msg 241 Level 16 - Conversion failed when converting date and/or time from character string. This means that the format date is incorrect.
Msg 241 Level 16 Example:
Invalid statement:
USE model;
GO
DECLARE @date date= '21-09-2014';
SELECT @date AS 'My date';
GO
Message |
---|
Msg 241, Level 16, State 1, Line 1 |
Conversion failed when converting date and/or time from character string. |
Correct statement:
USE model;
GO
DECLARE @date date= '09-21-2014';
SELECT @date AS 'My date';
GO
My date |
---|
2014-09-21 |
Other error messages:
- Is not a defined system type
- Conversion failed when converting the varchar value
- Unknown object type used in a CREATE, DROP, or ALTER statement
- Cannot insert the value NULL into column
- Cannot insert explicit value for identity column in table
- The INSERT statement conflicted with the FOREIGN KEY constraint
- The DELETE statement conflicted with the REFERENCE constraint