Re: Permission to restore databases and access them without being
- From: Erland Sommarskog <esquel@xxxxxxxxxxxxx>
- Date: Mon, 11 Aug 2008 00:45:44 -0700
"Charles Wang [MSFT]" (changliw@xxxxxxxxxxxxxxxxxxxx) writes:
You can first grant CREATE DATABASE or assign the fixed server role
dbcreator to the login so that you can restore the databases. You can
find more detailed information in the section "Permission" of "RESTORE
(Transact-SQL)" in SQL Server 2005 Books Online:
http://msdn.microsoft.com/en-us/library/ms186858.aspx
After that, assign your wanted permissions such as db_reader/db_writer
etc to the user on the newly restored databases, but do not assign any
permissions or database roles to the other databases. Of course, if you
want to give thinner granular permission control, you can use GRANT
statements. Please refer to: GRANT Database Permissions (Transact-SQL)
http://msdn.microsoft.com/en-us/library/ms178569.aspx
Charles, the issue is that if the login who performs the RESTORE does not
map to a user in the database, the RESTORE operation fails, even if the
user in the dbcreator role. I know, because I tested this, before I
made my post.
--
Erland Sommarskog, SQL Server MVP, esquel@xxxxxxxxxxxxx
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
.
- Follow-Ups:
- Re: Permission to restore databases and access them without being
- From: "Charles Wang [MSFT]"
- Re: Permission to restore databases and access them without being
- References:
- Permission to restore databases and access them without being sysa
- From: LenaMsdn08
- Re: Permission to restore databases and access them without being sysa
- From: Erland Sommarskog
- Re: Permission to restore databases and access them without being
- From: LenaMsdn08
- Re: Permission to restore databases and access them without being
- From: "Charles Wang [MSFT]"
- Permission to restore databases and access them without being sysa
- Prev by Date: Re: Permission to restore databases and access them without being
- Next by Date: Re: Permission to restore databases and access them without being
- Previous by thread: Re: Permission to restore databases and access them without being
- Next by thread: Re: Permission to restore databases and access them without being
- Index(es):
Relevant Pages
|