Ishan
Ishan

Reputation: 67

How to protect or hide backend data while using SQL server as Database?

Is it possible to hide the databases used in my application from the user. What I need is that when user opens SQL Server management studio, he should not see the databases used in my application developed in C# and VB6

Upvotes: 0

Views: 465

Answers (4)

scorpdaddy
scorpdaddy

Reputation: 303

Accessing the database with a user login only gives access to the databases for which that use has been given permission. Different users have access to different databases. Perhaps you have 3 users: root, admin, user.

As a start point, try looking at http://msdn.microsoft.com/en-us/library/ms187936.aspx

Upvotes: 1

sorpigal
sorpigal

Reputation: 26086

Don't grant the user permission to access the database. Instead embed credentials in to your program that allow it to access the DB via a dedicated account. When the user uses your program the program's user is granted access, but if the user tries connect directly he is denied access.

Upvotes: 0

4b0
4b0

Reputation: 22323

You would need to revoke the permission 'VIEW ANY DATABASE' from the role PUBLIC (SQL SERVER 2005 onwards).From Stackoverflow. For more details see a ans Hide SQL database from Management Studio

Upvotes: 0

Fabske
Fabske

Reputation: 2126

There are 2 ways to forbid access to db content:

  • Encrypting db content : will decrease performance
  • Autorisations: you create a user specifically for your application, put it as db owner, and remove access for all users. And also you need to disable Windows Authentication connection in MsSQL server, so that admin cannot connect this way.

Upvotes: 4

Related Questions