|
|
|
SSC-Enthusiastic
      
Group: General Forum Members
Last Login: Tuesday, May 07, 2013 9:53 AM
Points: 144,
Visits: 479
|
|
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.
|
|
|
|
|
SSCertifiable
       
Group: General Forum Members
Last Login: Today @ 4:48 AM
Points: 6,727,
Visits: 11,774
|
|
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
Believe you can and you're halfway there. --Theodore Roosevelt
Everything Should Be Made as Simple as Possible, But Not Simpler --Albert Einstein
The significant problems we face cannot be solved at the same level of thinking we were at when we created them. --Albert Einstein
1 apple is not exactly 1/8 of 8 apples. Because there are no absolutely identical apples. --Giordy
|
|
|
|