SET ANSI_WARNINGS ON
This is a small example to understand the behaviour of SET ANSI_WARININGS option.
----Here SET ANSI_WARNINGS is ON
SET ANSI_WARNINGS ON
IF EXISTS(SELECT * FROM SYS.OBJECTS WHERE TYPE='U' AND [Name]='AnsiWarningsOn')
BEGIN
DROP TABLE AnsiWarningsOn
END
CREATE TABLE AnsiWarningsOn
([Name] VARCHAR(2))
INSERT INTO AnsiWarningsOn
VALUES('Ramesh Mamillapalli')
-----SET ANSI_WARNINGS is OFF
SET ANSI_WARNINGS OFF
IF EXISTS(SELECT * FROM SYS.OBJECTS WHERE TYPE='U' AND [Name]='AnsiWarningsOn')
BEGIN
DROP TABLE AnsiWarningsOn
END
CREATE TABLE AnsiWarningsOn
([Name] VARCHAR(2))
INSERT INTO AnsiWarningsOn
VALUES('Ramesh Mamillapalli')
SELECT * FROM AnsiWarningsOn
----Here SET ANSI_WARNINGS is ON
SET ANSI_WARNINGS ON
IF EXISTS(SELECT * FROM SYS.OBJECTS WHERE TYPE='U' AND [Name]='AnsiWarningsOn')
BEGIN
DROP TABLE AnsiWarningsOn
END
CREATE TABLE AnsiWarningsOn
([Name] VARCHAR(2))
INSERT INTO AnsiWarningsOn
VALUES('Ramesh Mamillapalli')
-----SET ANSI_WARNINGS is OFF
SET ANSI_WARNINGS OFF
IF EXISTS(SELECT * FROM SYS.OBJECTS WHERE TYPE='U' AND [Name]='AnsiWarningsOn')
BEGIN
DROP TABLE AnsiWarningsOn
END
CREATE TABLE AnsiWarningsOn
([Name] VARCHAR(2))
INSERT INTO AnsiWarningsOn
VALUES('Ramesh Mamillapalli')
SELECT * FROM AnsiWarningsOn
Comments