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 2005 Forums
 SQL Server Administration (2005)
 Grant view for a specific database

Author  Topic 

jayram
Starting Member

47 Posts

Posted - 2013-09-11 : 11:17:12
How can i grant view only to one database for a user?

Should i have to grant view to ANY and then individually DENY VIEW for other databases?

Thanks

Jay

jayram
Starting Member

47 Posts

Posted - 2013-09-11 : 12:29:19
never mind i was able to get it from below

http://social.msdn.microsoft.com/Forums/sqlserver/en-US/a989ca87-660d-41c4-9dac-70b29a83ddfb/hide-database-names-from-unauthroized-users-in-ssms

"This is possible for a single user login as you can only asign ownership of a database to a single user.
Should be ok for most small hosting situations. This is how I achieved it under SQL server 2008...


1. Right click the users logon under the users database if they exist and remove
(Note: Do not remove the user from under the main security login)

2. Run the following query

USE <customersdatabase>

ALTER AUTHORIZATION ON DATABASE::<customerdatabase> to <customerlogin>


USE MASTER

DENY VIEW ANY DATABASE TO <customerlogin>"
Go to Top of Page
   

- Advertisement -