Click to See Complete Forum and Search --> : [RESOLVED] Restricting Access to Tables - SQL Server


George1111
August 21st, 2009, 09:11 AM
I have a SQL Server Database 2005

I would like to be able to "lock out" some tables so that a programmer connecting to the database cannot access certain tables

Is this possible ?

Alternatively, I guess we could create anoth database which is a copy of the main database EXCLUDING the tables I want secured, and allow the programmer to access the new database for reporting, etc

What is the normal way to deal with this requirement ?

Thanks

rdrast
August 21st, 2009, 11:45 AM
That is exactly what security in SQL Server is all about.

You can restrict (or grant) access to anything, nothing, or anything in between. Either manually clamp down on access for that single login, or create a 'Programmer' schema, and apply it to the login.

You can even restrict access based on columns if you care to go that bad.

Shuja Ali
August 21st, 2009, 05:30 PM
Some links that would help:
Create a user: http://msdn.microsoft.com/en-us/library/ms173463.aspx
Assign a specific role to the user: http://msdn.microsoft.com/en-us/library/ms187750.aspx
Grant permissions on SQL Objects: http://msdn.microsoft.com/en-us/library/ms188371.aspx

Alsvha
August 22nd, 2009, 05:35 AM
Read the links provided above:

Basically - you create different users. Assign those users with the proper rights, to the proper tables and presto - access is restricted :)

George1111
August 23rd, 2009, 09:20 PM
What more could I ask for ?

Thanks Guys - terriffic ! :wave: