Question

  Asked: May 11 2008   7:49 PM GMT
  Asked by: DetayMan


Access rights in SQL Server 2005 users


SQL Server 2005, SQL Server security, ADO

Hello,

I'm using Ms SQL Server 2005. I'm connecting server via ADO.

I have a question about access rights. Let me tell this with an example.

Let's say I have a database named as DB. In DB there are 3 tables. TBL_1, TBL_2, TBL_3.

I want to create a SQL user which will have all righst on TBL_1 and TBL_2. But I want this user to be able only reading TBL_3 (ne delete, update or insert). There is something called shemma in SQL server, bu I couldn't under stand the usage. Would you please tell me step by step how I can to things above.

Like;
Step 1: Open SQL manager Logins

Step 2: Do XXXXX

Step 3: Do YYYY

Final step: Ceonnect with the username and password to DB

Regards,

Subscribe to Alerts! Get questions and answers delivered to your Inbox.


E-mail me updates on this question



   SUBSCRIBE

hidden modal window

Answer Wiki (Improve, edit or add to this answer)


 RATE THIS ANSWER
+1
Click to Vote:
  •   1
  •  0



Add the user to the database.

Use the GRANT command to grant the user rights to the table


GRANT SELECT, INSERT, UPDATE, DELETE ON TBL_1 TO UserName
GRANT SELECT, INSERT, UPDATE, DELETE ON TBL_2 TO UserName
GRANT SELECT ON TBL_3 TO UserName
  • AddThis Social Bookmark Button

Browse more Questions and Answers on SQL Server and Development.

Looking for relevant SQL Server Whitepapers? Visit the SearchSQLServer.com Research Library.


Discuss This Answer


You must be logged-in to discuss a question. Log-in/Register

Mrdenny  |   May 12 2008  12:04AM GMT

Check out my SQL Server blog “SQL Server with Mr Denny” for more SQL Server information.