Brad Roland


Hi All,
I've got an SQL 2005 server setup with some databases. I'm trying to set it up so that a user can upload his database backup and then restore the DB using Studio Express but am having some issues with it. The user can upload his database fine, but when we try and go in to restore it, he can't view the directory or file of the backup. I've added the service account that SQL runs as, as well as the SQL2005%Machine%etc... user without much luck. The only thing I can think of from here is SQL permissions and I'm a little vague on how to accomplish what I want. One other thing is that if I add sysadmin rights to the user, they can see the directories fine. I tried adding dbcreator as recommended by other posts and that didn't work either. Any help would be greatly appreciated. Thanks!

Brad



Re: SQL Restore Rights

Michael Hotek


This is the way the security infrastructure was designed. Even if someone has the ability to run a system stored procedure or extended stored procedure (which is what is used to populate the GUI in Management Studio), they will only see the Windows resources which their account has the authority to see in the first place. They can see the directories and files when you add them to the sysadmin group, because the sysadmin group's Windows authoirty is mapped to the Windows security credentials of the SQL Server service account which therefore allows them to then see any Windows resources which the SQL Server service account has access to.

What you should do is grant then CREATE DATABASE permission along with adding a SQL Server credential which has the authority to view the directory which the files are being uploaded to. Then map the credential to the user's login. The following BOL article will help. ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/udb9/html/81c632cc-9d6c-486f-8590-4819517e6006.htm







Re: SQL Restore Rights

Brad Roland

Hi Mike,
Thanks for the quick response on that. I'll take a look at that BOL and see what I can come up with. Again, thanks for the quick help Smile

Brad





Re: SQL Restore Rights

Brad Roland

Hi Mike,
That looks to be exactly what I needed but I'm having a bit of an issue. On the Login Properties - General page, I can't seem to see anything labeled Credentials. I see the main username at the top, but no where that I can specify the credentials that I created. I tried using the ALTER USER command and it appeared to have worked, although I'm still in the same situation of not being able to see the backup location. Do you or anyone else reading this know how I can view the SQL login properties so that I can see if the credentials have been associated with that SQL account And why am I missing the credentials section in the properties in the first place! Smile Thanks for all the help

Brad




Re: SQL Restore Rights

Brad Roland

When I tried to delete the created credentials, it gave me an error that they were in use, so I'm guess that is working, but I still can't see any of the backup locations. Does anyone have anything else that I can try Thanks!

Brad