4

I have created a database in SQL Server 2008 and it shows in server object explorer to all users that can login to SQL.

I want to hide it from those users, I want it to be viewable by me only.

How can I do that? Any help, suggestions?

Many thanks

  • As far as I know, you cannot do this in SQL Server Management Studio. Everyone sees all databases - whether they can use anything inside them or not. – marc_s Mar 10 '11 at 14:21
  • Just because they can see it, it doesn't mean they can access it. If you need to hide the existence of a database from other users, use a separate server (or instance) –  Mar 10 '11 at 14:23
  • possible duplicate of [Setup a SQL Server database that's only visible to certain users](http://stackoverflow.com/questions/4799812/setup-a-sql-server-database-thats-only-visible-to-certain-users) – p.campbell Mar 10 '11 at 14:35

3 Answers3

6

Try this: In SQL Server Management Studio, right click the server and click "Properties". Click on "Permissions" and then select the "Public" role and remove "Grant" from "View Any Database".

Kordonme
  • 125
  • 2
  • 8
0

USE master; GO

DENY VIEW ANY DATABASE TO [loginname]; GO

USE [your db]; GO

DROP USER [loginname]; GO

USE master; GO

ALTER AUTHORIZATION ON DATABASE::[your db]TO [loginname]; GO

0

DbDefence can hide database schema from anyone including DBA. It's completely free for SQL Server 2008 without limits.

I'm associated with the vendor. Hope its not advertising because the product is free.