1

What is the minimum privilege needed to execute ALTER DATABASE {db_name} SET ARITHABORT ON?

I found that the privilege ALTER ANY DATABASE would suffice this, but I wonder if there isn't any other "smaller" privilege that does the same thing, because I think this permission is too broad and maybe I'll not have it in production environment.

4
  • 1
    I'm curious why you need to turn on ARITHABORT. It's on by default if for all databases with compatibility level 90 (SQL 2005) or higher.
    – Dan Guzman
    Commented Mar 28, 2018 at 0:24
  • @DanGuzman I don't use this compatibility level. This setting is OFF by default on my database (same in SQL 2014, 2016 and 2017). Commented Mar 28, 2018 at 12:45
  • All databases have a compatibility level, which will be at least 90 unless you are running SQL 2005. The default database set options can turn effective session options on but not off. So arithabort will be effectively on in SQL 2008 and later regardless of the default database setting unless the app explicitly execute SET AROTHABORT OFF. No need to change the database setting, AFAIK.
    – Dan Guzman
    Commented Mar 28, 2018 at 12:56
  • Well, ended up I changed the user options, so new sessions start with ARITHABORT ON. It worker out for me. Commented Mar 29, 2018 at 0:29

1 Answer 1

1

Well, ended up I changed the user options, so new sessions start with ARITHABORT ON. It worker out for me.

Here's a link better explaining how: Make SqlClient default to ARITHABORT ON

I've used the "Server-wide" part of it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.