Select failed because the following set options are incorrectly set: 'arithabort'

Source: Internet
Author: User

When you try to update a table referenced by the index view on SQL Server, you may retrieve the following errors:

Insert failed because the following set options are incorrectly set: 'arithabort'

When you create or operate an index on a calculated column or index view, set ansi_nulls must also be on. If set ansi_nulls is off, the CREATE, update, insert, and delete statements on the table with an index on the calculation column or index view will fail. SQL Server Returns An error listing all set options that violate the required values. In addition, if set ansi_nulls is off when the SELECT statement is executed, SQL Server ignores the index value on the calculated column or view and parses the selection, it is like no such index on a table or view.

 

Solution:

1. You must set arithabort on before tsql,CodeAs follows:

Set arithabort on
Go
Insert into ta ..

2. In ADO, you can write (C # code) like this)

Myconnection. Execute ("set arithabort on ");

If you are in trouble or cannot change it for some reason, you can try to modify the SQL Server server option.

3. Exec sp_dboption 'yourdb', 'arithabort ', 'true'

Yes

4. Alter database yourdb
Set arithabort on

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.