C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Reviews   Communities   Interview   Jobs   Projects   Training   Your Ad Here    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing | Lobby | Gift Shop |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...






Forums » .NET » SQL Server »

set ANSI_WARNINGS ON/OFF


Posted Date: 11 Jun 2007      Posted By: Harshada Joshi      Member Level: Silver     Points: 2   Responses: 1



HI,

What are advantages and disadvantages of set ANSI_WARNINGS ON/OFF

if i set it ot off what will happen?

regards,

Harshada





Responses

Author: Abhishek Arya    11 Jun 2007Member Level: DiamondRating: 2 out of 52 out of 5     Points: 2

When ON, if null values appear in aggregate functions (such as SUM, AVG, MAX, MIN, STDEV, STDEVP, VAR, VARP, or COUNT) a warning message is generated. When OFF, no warning is issued.


When ON, divide-by-zero and arithmetic overflow errors cause the statement to be rolled back and an error message is generated. When OFF, divide-by-zero and arithmetic overflow errors cause null values to be returned. The behavior in which a divide-by-zero or arithmetic overflow error causes null values to be returned occurs if an INSERT or UPDATE is attempted on a character, Unicode, or binary column in which the length of a new value exceeds the maximum size of the column. If SET ANSI_WARNINGS is ON, the INSERT or UPDATE is canceled as specified by the SQL-92 standard. Trailing blanks are ignored for character columns and trailing nulls are ignored for binary columns. When OFF, data is truncated to the size of the column and the statement succeeds.

Note When truncation happens in any conversion to or from binary or varbinary data, no warning or error is issued, regardless of SET options.



Post Reply

 This thread is locked for new responses. Please post your comments and questions as a separate thread.
If required, refer to the URL of this page in your new post.


Next : Question related to MS SQL server & ASP?
Previous : Convert SQL Server Stored Procedure into Oracle Stored Procedure( Very Urgent Plzzzzzzzzz)
Return to Discussion Forum
Post New Message
Category: SQL Server

Related Messages



dotNet Slackers

About Us    Contact Us    Privacy Policy    Terms Of Use