hi there,
i have a question in giving access to separate table to users.

i have a database call Admin and in that there are some tables that the one user should not aloowed in viewing,
how can i restric that user in avoing looking at that table
i am using MS SQL 2008.

appriciate a lot

if someoen can guide me
thanxxxxxx

Recommended Answers

All 3 Replies

There are many ways to do this, but here's one way to do it from the Management Studio:
Under the server, expand security and expand Logins.
Create a new login.
Under Server Roles, keep the login as Public.
Under User mapping, check the database that you want the user to have access to.
Under database role membership, give the user the appropriate role (db_datareader, db_datawriter...).
Click Ok.

Under the database, expand users and double click the user.
Under securables, click Search button, and select object types, tables. Check the table and click ok.
At the bottom, explicitly deny permissions to the table.

There are many other ways to accomplish this, but this way will work.

There are many ways to do this, but here's one way to do it from the Management Studio:
Under the server, expand security and expand Logins.
Create a new login.
Under Server Roles, keep the login as Public.
Under User mapping, check the database that you want the user to have access to.
Under database role membership, give the user the appropriate role (db_datareader, db_datawriter...).
Click Ok.

Under the database, expand users and double click the user.
Under securables, click Search button, and select object types, tables. Check the table and click ok.
At the bottom, explicitly deny permissions to the table.

There are many other ways to accomplish this, but this way will work.

hey thanx
i have another question as well

how can i hame a grop call Solar and then add users to that group and then give access to that group so that the users in those group has different permissions

please can u help me thins

thanxxx
appriciate a lot
thanxxxxx

There are 2 parts to this. The first part (creating the group and adding users) is done at the server level.

Click Start->Administrative Tools->Computer Management.
Click Local Users and groups. Open groups. Right click and select Add Group.
Name your group and apply server level permissions.
After you create the group, add the users.

Log into Sql Server Management Studio.
Create a login that uses Windows Authentication. Use the new group as the username. Assign server permissions. Assign database permissions.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.