# User Administration for SQL Server

It is recommended that each user be assigned a personal database account with only the required privileges. For more information, please refer to the SQL Server product documentation.

Note, this topic only provides instructions for performing the setup on the same computer as SQL Server while logged in as the same user that installed SQL Server.

Perform the following steps for any user that will need access to the pdfkeeper database. Substitute the user name and password for user_name and password.

1. Open a Command Prompt.

2. Execute sqlcmd -S localhost\<Instance Name>

- Replace <Instance Name> with the instance name of the SQL Server Database Engine you want to connect to. For SQL Server (not Express), do not specify -S localhost\<Instance Name> if you accepted the default instance name MSSQLSERVER during the installation of SQL Server. For SQL Server Express, you can specify sqlexpress if you accepted the default instance name during the installation of SQL Server Express.

3. Enter use pdfkeeper then press <Enter> and then enter go and then press <Enter>.

4. For a new user, enter the following statement: create user user_name with password = 'password' then press <Enter> and then enter go and then press <Enter>. For more information, see the SQL Server product documentation.

5. For a new account, enter the following statement to grant the user select/query access: grant select on docs to user_name then press <Enter> and then enter go and then press <Enter>.

6. To give the user the ability to upload documents, enter the following statement: grant insert on docs to user_name then press <Enter> and then enter go and then press <Enter>.

7. To give the user the ability to update documents, enter the following statement: grant update on docs to user_name then press <Enter> and then enter go and then press <Enter>.

8. To give the user the ability to delete documents, enter the following statement: grant delete on docs to user_name then press <Enter> and then enter go and then press <Enter>.

9. To prevent the user from uploading documents, enter the following statement: revoke insert on docs from user_name then press <Enter> and then enter go and then press <Enter>.

10. To prevent the user from updating documents, enter the following statement: revoke update on docs from user_name then press <Enter> and then enter go and then press <Enter>.

11. To prevent the user from deleting documents, enter the following statement: revoke delete on docs from user_name then press <Enter> and then enter go and then press <Enter>.