Adrian Hills 4/6/2010

SQL CAST to VARCHAR without size

Read Original

This technical article details a common SQL Server pitfall: using CAST or CONVERT to VARCHAR without specifying a length. It explains that the default length is 30, which can cause arithmetic overflow errors with large numbers, and that declaring a VARCHAR variable without a length defaults to 1, leading to silent truncation. The post serves as a warning and best practice guide for developers.

SQL CAST to VARCHAR without size

Comments

No comments yet

Be the first to share your thoughts!

Browser Extension

Get instant access to AllDevBlogs from your browser

Top of the Week