Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
DB Engine
SQL ServerMSDESQL Server CE
Services
Analysis (Data Mining)Analysis (OLAP)DTSIntegration ServicesNotification ServicesReporting Services
Programming
CLRConnectivitySQLXML
Other Technologies
ClusteringEnglish QueryFull-Text SearchReplicationService Broker
General
Data WarehousingPerformanceSecuritySetupSQL Server ToolsOther SQL Server Topics
DirectoryUser Groups
Related Topics
MS AccessOther DB ProductsMS Server Products.NET DevelopmentVB DevelopmentJava DevelopmentMore Topics ...

SQL Server Forum / General / Security / November 2008

Tip: Looking for answers? Try searching our database.

How do I drop DBO access to a DB?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
TLuebke - 13 Nov 2008 15:40 GMT
I'm running an SQL 2005 in a classroom environment. Students are allowed to
create databases and did so last night for a test. The instructor wants me to
deny them access to the DB's they created so she can grade them. I can't seem
to drop them from their DB's because they are linked as DBO.

How do I deny them access to a particular DB that they created?
I've tried sp_changedowner, revoke access and a few other scripts.
Uri Dimant - 16 Nov 2008 07:54 GMT
Hi
Because those users are members of db_owner database role or even sysdamin
on the instance?
Remove them from db_owner  database role  and make them to login with
separate login to the instance

> I'm running an SQL 2005 in a classroom environment. Students are allowed
> to
[quoted text clipped - 6 lines]
> How do I deny them access to a particular DB that they created?
> I've tried sp_changedowner, revoke access and a few other scripts.
Erland Sommarskog - 16 Nov 2008 19:17 GMT
> I'm running an SQL 2005 in a classroom environment. Students are allowed
> to create databases and did so last night for a test. The instructor
[quoted text clipped - 4 lines]
> How do I deny them access to a particular DB that they created?
> I've tried sp_changedowner, revoke access and a few other scripts.

Changing database owner (ALTER AUTHORIZATION is the preferred in SQL 2005)
should to the trick. Since they are no longer databaser owners, they should
not be able to access the databases - unless the guest account is enabled.

An alternative would be to detach the databases, and then attach them to
a server to which only the instructor has access.

Signature

Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

Links for SQL Server Books Online:
SQL 2008: http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx
SQL 2005: http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx
SQL 2000: http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2010 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.