SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Old Forums
 CLOSED - General SQL Server
 Revoking/Denying Rights On Database???
 Forum Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

majidbhutta
Starting Member

13 Posts

Posted - 09/15/2006 :  23:55:14  Show Profile
Well Dears!
I have a database script that i run from C# code , i Connect to sqlexpress via windows authentication or sa login, Script does the following things
1) Create a Database SECUREDB (Tables, Procedures etc).
2). create a new LOGIN
3) change database owner (sp_changedbowner) of SECUREDB to the new LOGIN
4.---------------?
At the end i want to to revoke all rights of all logins including Windows Authentication from SECUREDB EXCEPT the one new LOGIN so that only new LOGIN should be able to connect to SECUREDB.
i need help in this regard how to do that. Any Script example or article would be highly appreciated.I am using SQLEXPRESS.
THNX IN ADVANCE

Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)

USA
7020 Posts

Posted - 09/16/2006 :  00:01:13  Show Profile
Any login in the sysadmin fixed server role, for example SA, will still be able to connect to the database.

There is no way to prevent it if a login is sysadmin.





CODO ERGO SUM
Go to Top of Page
  Previous Topic Topic Next Topic  
 Forum Locked
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.06 seconds. Powered By: Snitz Forums 2000