Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

UPDATE failed because the following SET options have incorrect settings: Expand / Collapse
Author
Message
Posted Wednesday, March 6, 2013 4:27 PM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Monday, August 25, 2014 8:35 AM
Points: 163, Visits: 574
I Created a UniqueIndex on a Test Table with Some condition as below and user were getting error msg as below while updating the test table by using the Stored Proc that was generating form Visual Studio.Net Project Solution
So with out changing the Stored Proc is there any way to get ride of this error msg by creating a Unique Constraint as i was doing below
Thanks In Advance

Index:
CREATE UNIQUE NONCLUSTERED INDEX UNQ__XYXXXX__ABCD
ON [dbo].[Test]([ID] ASC) WHERE ID IS NOT NULL WITH (ALLOW_PAGE_LOCKS = ON, ALLOW_ROW_LOCKS = ON, PAD_INDEX = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, IGNORE_DUP_KEY = OFF, STATISTICS_NORECOMPUTE = OFF, ONLINE = OFF, MAXDOP = 0)
ON [Primary];

ErrorMsg:
Msg 1934, Level 16, State 1, Procedure Test_Update, Line 56
UPDATE failed because the following SET options have incorrect settings: 'ANSI_NULLS'. 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 data type methods and/or spatial index operations.

Post #1427682
Posted Thursday, March 7, 2013 4:24 PM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Yesterday @ 7:34 AM
Points: 7,098, Visits: 12,606
RamSteve (3/6/2013)
I Created a UniqueIndex on a Test Table with Some condition as below and user were getting error msg as below while updating the test table by using the Stored Proc that was generating form Visual Studio.Net Project Solution
So with out changing the Stored Proc is there any way to get ride of this error msg by creating a Unique Constraint as i was doing below
Thanks In Advance

Index:
CREATE UNIQUE NONCLUSTERED INDEX UNQ__XYXXXX__ABCD
ON [dbo].[Test]([ID] ASC) WHERE ID IS NOT NULL WITH (ALLOW_PAGE_LOCKS = ON, ALLOW_ROW_LOCKS = ON, PAD_INDEX = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, IGNORE_DUP_KEY = OFF, STATISTICS_NORECOMPUTE = OFF, ONLINE = OFF, MAXDOP = 0)
ON [Primary];

ErrorMsg:
Msg 1934, Level 16, State 1, Procedure Test_Update, Line 56
UPDATE failed because the following SET options have incorrect settings: 'ANSI_NULLS'. 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 data type methods and/or spatial index operations.


Check the stored proc looking for something like:

SET ANSI_NULLS OFF;

If you see it, then you will likely need to modify the proc to remove it.

If the proc does not contain it then chances are the option is being set on the connection before the proc is called, either by the driver the client app is using or explicitly by the application code prior to calling the proc.

In either case you will need to get it to the point where the update on the table is carried out while ANSI_NULLS is ON.


__________________________________________________________________________________________________
There are no special teachers of virtue, because virtue is taught by the whole community. --Plato
Post #1428318
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse