Getting an "incorrect settings: 'ANSI_NULLS., QUOTED_IDENTIFI ER'."
error after creating a view.
We wanted a composite unique constraint that ignored nulls, so we set
up a view using the following script:
/* --- start --- */
BEGIN TRANSACTION
SET QUOTED_IDENTIFI ER ON
SET ARITHABORT ON
SET NUMERIC_ROUNDAB ORT OFF
SET CONCAT_NULL_YIE LDS_NULL ON
SET ANSI_NULLS ON
SET ANSI_PADDING ON
SET ANSI_WARNINGS ON
COMMIT
GO
CREATE VIEW vw_MyView
WITH SCHEMABINDING
AS
SELECT Col1, Col2 FROM dbo.MyTable WHERECol2 IS NOT NULL
GO
/* --- end --- */
and then added the constraint to the new view
/* --- start --- */
CREATE UNIQUE CLUSTERED INDEX AK_MyTable_Cons traint1 ON
vw_MyView(Col1, Col2)
GO
/* --- end --- */
I thought we were doing fine, 'til we started running some DELETE
stored procedures and got the above error. The error also cited
ARITHABORT as an incorrect setting until we ran this script:
/* --- start --- */
USE master
DECLARE @value int
SELECT @value = value FROM syscurconfigs
WHERE config = 1534
SET @value = @value | 64
EXEC sp_configure 'user options', @value
RECONFIGURE
/* --- end --- */
TIA to anyone kind enough to shed some light on this for me. Is there
something we should have done differently in creating the view and
index? If not, what's the procedure for working through these
settings errors?
I've read through some other threads on this subject, but didn't
really find what I was looking for. Thanks again for any help. Would
be appreciated.
-matt
error after creating a view.
We wanted a composite unique constraint that ignored nulls, so we set
up a view using the following script:
/* --- start --- */
BEGIN TRANSACTION
SET QUOTED_IDENTIFI ER ON
SET ARITHABORT ON
SET NUMERIC_ROUNDAB ORT OFF
SET CONCAT_NULL_YIE LDS_NULL ON
SET ANSI_NULLS ON
SET ANSI_PADDING ON
SET ANSI_WARNINGS ON
COMMIT
GO
CREATE VIEW vw_MyView
WITH SCHEMABINDING
AS
SELECT Col1, Col2 FROM dbo.MyTable WHERECol2 IS NOT NULL
GO
/* --- end --- */
and then added the constraint to the new view
/* --- start --- */
CREATE UNIQUE CLUSTERED INDEX AK_MyTable_Cons traint1 ON
vw_MyView(Col1, Col2)
GO
/* --- end --- */
I thought we were doing fine, 'til we started running some DELETE
stored procedures and got the above error. The error also cited
ARITHABORT as an incorrect setting until we ran this script:
/* --- start --- */
USE master
DECLARE @value int
SELECT @value = value FROM syscurconfigs
WHERE config = 1534
SET @value = @value | 64
EXEC sp_configure 'user options', @value
RECONFIGURE
/* --- end --- */
TIA to anyone kind enough to shed some light on this for me. Is there
something we should have done differently in creating the view and
index? If not, what's the procedure for working through these
settings errors?
I've read through some other threads on this subject, but didn't
really find what I was looking for. Thanks again for any help. Would
be appreciated.
-matt
Comment