This article is half-done without your Comment! *** Please share your thoughts via Comment ***
In this post, I am sharing login script to allow a database backup in SQL Server.
If you are getting a below error, you need to be a member of DBCREATOR server role and DB_OWNER database role.
1 2 3 4 |
Msg 262, Level 14, State 1, Line 1 BACKUP DATABASE permission denied in database 'DatabaseName'. Msg 3013, Level 16, State 1, Line 1 BACKUP DATABASE is terminating abnormally. |
Script to create login with “dbcreator” server role and “db_owner” database role:
1 2 3 4 5 6 7 8 |
CREATE LOGIN Backup_Restore_User WITH PASSWORD='admin12338' GO CREATE USER Backup_Restore_User FOR LOGIN Backup_Restore_User GO EXEC sp_addsrvrolemember 'Backup_Restore_User', 'dbcreator' GO EXEC sp_addrolemember 'db_owner','Backup_Restore_User' GO |
Leave a Reply