Error:

Getting the following error when running a stored procedure…

SELECT INTO failed because the following SET options have incorrect settings: ‘ANSI_WARNINGS’. Verify that SET options are correct for use with indexed views and/or indexes on computed columns and/or filtered indexes and/or query notifications and/or XML

SET NOCOUNT ON;
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
SET ANSI_WARNINGS OFF;

Fix:

SET ANSI_WARNINGS ON;

Sources:

https://social.msdn.microsoft.com/Forums/sqlserver/en-US/95752aba-2c39-4aca-be2b-a2ee9e3d70da/select-into-failed-because-the-following-set-options-have-incorrect-settings-ansiwarnings?forum=sqldataaccess

https://docs.microsoft.com/en-us/sql/t-sql/statements/set-ansi-warnings-transact-sql?view=sql-server-ver15

Last modified: November 12, 2020

Author

Comments

Write a Reply or Comment