Grant SQL Server Permissions to a Folder for Backups or Database Files

By:   |   Updated: 2023-12-15   |   Comments   |   Related: > Security


Problem

Sometimes there is a need to move SQL Server files or write backups to different drives and or folders. To make sure the SQL Server service account has access you might need to grant permissions to these new file locations. In this article, we will look at the steps to do so.

Solution

For this example, let's say we need to create a new folder for database backup files. You can create the folder anywhere on the machine. After creating the folder, you need to give the SQL Server instance service account permissions to the folder, below are the steps.

This same process could be used if you want to use a different folder for database data and log files.

Creating a Folder and Grant Permissions

First create the folder, for this example we are creating the folder C:\Backup.

Next open SQL Server Configuration Manager to get the account used for the SQL Server service.

Sql Server Configuration Manager

Double click on the SQL Server name to open the Properties window. On the Log On tab copy the Account Name as shown below.

Copying account name

Now, navigate to the folder you created and right click on the folder and select Properties.

backup folder

Once on the Properties window (Backup Properties for our C:\Backup folder example), click the Security tab and click on the Edit button.

add user

On the next window, click the Add button.

add user

Now, paste the SQL Account Name you copied from the steps above in Enter the object names to select area and click the Check Names button.

check names

This will show you the SQL Account Name as stored on your system. After you see the Account Name, click OK.

verify account name

After adding the user, while the user is selected, check the Full control box and click Apply to make the change then press OK to close the window.

give control to folder

Great! You have created the folder for your backups and gave your SQL account user full control to this folder.

Next Steps


sql server categories

sql server webinars

subscribe to mssqltips

sql server tutorials

sql server white papers

next tip



About the author
MSSQLTips author Levi Masonde Levi Masonde is a developer passionate about analyzing large datasets and creating useful information from these data. He is proficient in Python, ReactJS, and Power Platform applications. He is responsible for creating applications and managing databases as well as a lifetime student of programming and enjoys learning new technologies and how to utilize and share what he learns.

This author pledges the content of this article is based on professional experience and not AI generated.

View all my tips


Article Last Updated: 2023-12-15

Comments For This Article

















get free sql tips
agree to terms