|
Posted by Erland Sommarskog on 05/15/07 22:00
(mplpost@yahoo.com) writes:
> Our web application requires that when a new Organization is created,a
> separate Database is to be created for the corresponding organization,
> so that each organization remains a separate entity with their
> corresponding employees(This is our clients requirement, so that they
> can later provide the backup of the database if the organization
> decides to move out). And for that what we intend to do is restore the
> backup of database which already has the objects created in it.So we
> intend to restore a database for the new organization from the web
> page.
Was the database originally created on the same server or on a different
server? Who is the owner of the original database?
> We are using SQL Server 2005 Enterprise Edition
Which Service Pack are you on? (There is some new commands in SP2
that may be useful.)
> I think most will suggest to use 'exec sp_changedbowner' to
> update the dbo, but for this we need sysadmin privileges, which we do
> not have for the xy login.
You could put ALTER AUTHORISZATION in a stored procedure that is signed
by a certificate, and then you grant a login created from that certificate
the rights change database owner. That login is not a real login that
can actually connect. For more information about this, see an article
on my web site: http://www.sommarskog.se/grantperm.html.
--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se
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
Navigation:
[Reply to this message]
|