Access rights in SQL Server 2005 users

5 pts.
Tags:
ADO
SQL Server 2005
SQL Server security
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,
ASKED: May 11, 2008  7:49 PM
UPDATED: October 16, 2013  9:40 PM

Answer Wiki

Thanks. We'll let you know when a new response is added.

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

Discuss This Question: 2  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following