%1! is not a valid style number when converting from datetime to a character string.

Error Message:
Msg 281, Level 16, State 1, Line 1
%1! is not a valid style number when converting from datetime to a character string.

Severity level:
16.

Description:
This error message appears when you try to use an invalid style number with the CONVERT() function.

Consequences:
The T-SQL statement can be parsed, but causes the error at runtime.

Resolution:
Error of the Severity level 15 are generated by the user and can be fixed by the SQL Server user. In this case you need to specify a valid style number.

Versions:
All versions of SQL Server.

Example(s):
SELECT CONVERT(VARCHAR, GETDATE(), 99)

Remarks:
99 is no valid style number for CONVERT(). The most commonly used ones you can find in the SQL Server Books Online (BOL) in the CAST and CONVERT topic.




Array

No comments yet... Be the first to leave a reply!

Software Reviews | Book Reviews | FAQs | Tips | Articles | Performance Tuning | Audit | BI | Clustering | Developer | Reporting | DBA | ASP.NET Ado | Views tips | | Developer FAQs | Replication Tips | OS Tips | Misc Tips | Index Tuning Tips | Hints Tips | High Availability Tips | Hardware Tips | ETL Tips | Components Tips | Configuration Tips | App Dev Tips | OLAP Tips | Admin Tips | Software Reviews | Error | Clustering FAQs | Performance Tuning FAQs | DBA FAQs |