Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


UPDATE failed because the following SET options have incorrect settings:


UPDATE failed because the following SET options have incorrect settings:

Author
Message
RamSteve
RamSteve
SSC-Enthusiastic
SSC-Enthusiastic (188 reputation)SSC-Enthusiastic (188 reputation)SSC-Enthusiastic (188 reputation)SSC-Enthusiastic (188 reputation)SSC-Enthusiastic (188 reputation)SSC-Enthusiastic (188 reputation)SSC-Enthusiastic (188 reputation)SSC-Enthusiastic (188 reputation)

Group: General Forum Members
Points: 188 Visits: 635
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.
Orlando Colamatteo
Orlando Colamatteo
SSCrazy Eights
SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)

Group: General Forum Members
Points: 8239 Visits: 14368
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
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search