Permissions Required to Run the ALTER DATABASE SET SINGLE_USER Statement on SQL Server 2008

I came across a situation where the following statement gives an error message due to which it could not be executed:

ALTER DATABASE [{0}] SET SINGLE_USER WITH ROLLBACK IMMEDIATE 

Unable to find information about required permissions on the Internet.

+4
source share
2 answers

ALTER DATABASE :

Requires ALTER permission for the database.

Some specific SET permissions are listed in ALTER DATABASE SET options :

  • EMERGENCY : ALTER DATABASE for the theme database requires the database to be changed offline or in disrepair. To move the database from offline to online, server level permission ALTER ANY DATABASE is required.
  • DB_CHAINING: CONTROL SERVER permission is required to set this option in the database.
  • TRUSTWORTHY: Setting this option requires CONTROL SERVER permission in the database.
+6
source

Try this from your administrator account:

 USE [YOUR_DB] GO GRANT ALTER TO your_user GO 

But remember that the login must have a user in the specified database.

Or, if you want to provide this permission for each database on the server, you can provide permission at the server level to the login:

 USE master GO GRANT ALTER ANY DATABASE TO your_login GO 
+1
source

Source: https://habr.com/ru/post/1402583/


All Articles