INSERT failed because the following SET options have incorrect settings: 'ANSI_NULLS., ARITHABORT'.

INSERT failed because the following SET options have incorrect settings: 'ANSI_NULLS., ARITHABORT'.

Post by timb » Tue, 17 Jun 2003 09:23:02



Hi,
    having more problems with the ansii nulls arithabort settings.  It
appears that under some circumstances my making changes to my stored
procedures is saving the stored procedures with the incorrect ansi nulls
settings. I have tables with computed columns and incorrect settings causes
inserts and upates to fail.

I have the following items ticked in the Server properties/connections.
Ansii nulls
Arithmetic Abort
Quoted Identifier
Ansii null defined on.

Are these the correct settings to ensure that any modifications to (or
creations of) stored procedures are done with the correct settings.

Another question is : is there are easy way to update all my stored
procedures with the correct settings without loosing data and without
changing each one individually ( i have over 150 stored procedures and
functions)?

thanks in advance

Tim B

 
 
 

INSERT failed because the following SET options have incorrect settings: 'ANSI_NULLS., ARITHABORT'.

Post by Greg Linwoo » Tue, 17 Jun 2003 11:14:18


Hi Tim.

I'm not sure about how to update your current 150+ stored
procs all at once - hopefully someone else can chip in
with that - but you'll probably want these settings set at
the database level, rather than just at the server level.
If you want these to apply to any NEW database, you
probably want them set in the model (template) database as
well.

You can do this via the ALTER DATABASE statement if you're
on a recent version of SQL Server, or sp_dboption if
you're on an older version.

Regards,
Greg Linwood
SQL Server MVP

Quote:>-----Original Message-----
>Hi,
>    having more problems with the ansii nulls arithabort
settings.  It
>appears that under some circumstances my making changes
to my stored
>procedures is saving the stored procedures with the

incorrect ansi nulls
Quote:>settings. I have tables with computed columns and

incorrect settings causes
Quote:>inserts and upates to fail.

>I have the following items ticked in the Server

properties/connections.
Quote:>Ansii nulls
>Arithmetic Abort
>Quoted Identifier
>Ansii null defined on.

>Are these the correct settings to ensure that any

modifications to (or
Quote:>creations of) stored procedures are done with the correct
settings.

>Another question is : is there are easy way to update all
my stored
>procedures with the correct settings without loosing data
and without
>changing each one individually ( i have over 150 stored
procedures and
>functions)?

>thanks in advance

>Tim B

>.


 
 
 

1. INSERT failed because the following SET options have incorrect settings: 'ARITHABORT'.

Hi,
    am updating a table via a stored procedure called by an adodb.command
object via VB6.
I get the following error description when i call the execute method.

INSERT failed because the following SET options have incorrect settings:
'ARITHABORT'.

I have located the following  knowledge article 305333.

I am using a table with an index on a computed column.
I have tried both calling a sp (set arithabort on ) from the sp which
updates my table i have also tried connection.execute ("set arithabort on")
and am still getting the error

Table def is

CREATE TABLE [dbo].[Users] (
 [UserID] AS (isnull((isnull([storeid],'') + substring('0000',1,(4 -
len(convert(varchar(10),isnull([StoreUserNo],0))))) +
convert(varchar(4),isnull([StoreUserNo],0))),'')) ,
 [StoreUserNo] [smallint] IDENTITY (1, 1) NOT NULL ,
 [StoreID] [char] (2) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
 [CardNumber] [smallint] NOT NULL ,
 [Forename] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
 [Surname] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
 [Password] [varchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
 [SecurityLevel] [tinyint] NOT NULL ,
 [Deleted] [bit] NOT NULL ,
 [Fullname] AS (isnull([forename],'') + ' ' + isnull([surname],''))
) ON [PRIMARY]
GO

ALTER TABLE [dbo].[Users] WITH NOCHECK ADD
 CONSTRAINT [PK_Users] PRIMARY KEY  CLUSTERED
 (
  [UserID]
 )  ON [PRIMARY]
GO

ALTER TABLE [dbo].[Users] ADD
 CONSTRAINT [DF_Users_StoreID] DEFAULT ('isnull(select top 1 StoreID from
parameters),'')') FOR [StoreID],
 CONSTRAINT [DF_User_Password] DEFAULT ('PASSWORD') FOR [Password],
 CONSTRAINT [DF_User_SecurityLevel] DEFAULT (0) FOR [SecurityLevel],
 CONSTRAINT [DF_Users_Deleted] DEFAULT (0) FOR [Deleted]
GO

 CREATE  INDEX [IX_Users_Surname_Forename] ON [dbo].[Users]([Surname],
[Forename]) ON [PRIMARY]
GO

 CREATE  UNIQUE  INDEX [IX_CardNumber] ON [dbo].[Users]([CardNumber]) ON
[PRIMARY]
GO

Can anyone help?

Thanks in advance

Tim B

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.443 / Virus Database: 248 - Release Date: 10/01/2003

2. Timeout Problem - Please help!!

3. DBCC failed SET options have incorrect settings

4. User input for variables in SP

5. UPDATE failed because the following SET options have incorrect settings: 'ARITHABORT'.

6. Can't register xblkld3.dll

7. SQL Server 2000 Trigger causes insert to fail on following insert statements

8. incorrect settings: 'ANSI_NULLS., QUOTED_IDENTIFIER'.

9. Incorrect Set Options issue

10. Inserting duplicate Records on the table having an option of IGNORE_DUP_KEY

11. Setting PDQ Priority >1 returns incorrect number of rows

12. Msg 1934, incorrect QUOTED_IDENTIFIER setting - why???