Posts

Showing posts with the label ANSI_WARNINGS

SQL Server, the ANSI_WARNINGS option

Image
Hi Guys, Welcome back! Have you five minutes to learn about the ANSI_WARNINGS option? Yes i suppose!   Introduction Some days ago we talked about the option XACT_ABORT . Seeing the great success today I will show you another option, the ANSI_WARNINGS! Who knows exactly what ANSI_WARNINGS is for? Well only five minutes of reading and you will know all about this option! ANSI_WARNINGS option The ANSI_WARNINGS option controls behavior of the SQL Server database engine for various error conditions. When the ANSI_WARNINGS option is set to ON, the engine follows the standard ISO behavior for this situations: Encountering a NULL value during an aggregation operation Encountering a Divide by Zero error String truncation Example for the string truncation Let's take a table name Table_A where the field CODICE is a varchar datatype with a length of 4 character: If i execute the insert below where in the field codice i insert a value that have a length greater than...