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.

Paul White
  • 67,511
  • 25
  • 368
  • 572
  • 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 Mar 28 '18 at 00: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). – Iúri dos Anjos Mar 28 '18 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 Mar 28 '18 at 12:56
  • Well, ended up I changed the user options, so new sessions start with ARITHABORT ON. It worker out for me. – Iúri dos Anjos Mar 29 '18 at 00:29

1 Answers1

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.