Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Administration (2000)
 Limit users to delete only their own databases

Author  Topic 

cubical99
Starting Member

2 Posts

Posted - 2003-12-09 : 07:28:34
Hi, I'm trying to configure SQL 2000 for an ASP environment in such a way that users can create and delete databases on SQL 2000. However, I only want the users to be able to read/delete their own (self-created) databases, not those databases that have been created by others. Is this possible?

Basically I want a 'light version' of the fixed dbcreator server role. Any help would be greatly appreciated.

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2003-12-09 : 12:42:23
You could grant the account dbcreator, but then on delete check if the user is the owner of the database. If it isn't, don't allow the delete. You are going to have to handle this on the application side and not on the database side.

Tara
Go to Top of Page

cubical99
Starting Member

2 Posts

Posted - 2003-12-10 : 06:10:33
Tara, thanks for the suggestion. However, in this case I do not control the application that's creating and deleting the databases. We host a shared SQL server, and one of our customers is writing it's own CMS application. This application needs to create and delete databases on the shared SQL server. Of course I do not want this customer's application to be able to delete the databases of other customers by mistake.

I'm still hopefull there's a solution for this dilemma.

Vincent.
Go to Top of Page

mr_mist
Grunnio

1870 Posts

Posted - 2003-12-10 : 06:32:38
I am thinking this must be why so many shared servers have fixed database allocation per customer...

Provide an ASP gateway for your customers to use. They can then use the ASP gateway to delete / create databases, and you can restrict permissions in sql to within their own databases.

-------
Moo. :)
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2003-12-10 : 12:07:36
Or how about install multiple instances of SQL Server on one database server? You don't need additional licenses for SQL Server for this. Each customer that needs the create and drop options for a database would get its own virtual server.

Tara
Go to Top of Page
   

- Advertisement -