Solved

How to assign table level permisssions in SQL SERVER 2005

Posted on 2009-04-03
7
777 Views
Last Modified: 2012-05-06


i have a SQL SERVER INSTANCE NAMED -  SQL EXPRESS

with  3 databases

one of them is  MARKET DB

which has 5 tables
1) HISTORY
2) ACCOUNTS
3) CAMPAIGN
4) LOGIN
5) RESPONSE

i have created a login named sam    and VP

by default,  the login sam can retrieve, select insert , update from the LOGIN TABLE
but i want to change that , SAM SHOULD Only be  able to select from the login table
but not update,delete or create any other table

VP should not have any access to response table
but he can create alter ,select update , insert , drop tables , other than response table

HOW DO I ACHIEVE THIS IN SQL SERVER 2005 ?

SHould i do it with SQL QUERIES or is there any other way

I am a newbie on this subject

0
Comment
Question by:viju2008
7 Comments
 
LVL 9

Assisted Solution

by:VikramMullick
VikramMullick earned 100 total points
ID: 24058285
0
 
LVL 1

Assisted Solution

by:hari_tailor
hari_tailor earned 100 total points
ID: 24058336
GRANT and REVOKE Statement are SQL Server, you can see more detail of statment  and Object permission in SQL Help

Example GRANT SELECT ON LOGIN TO sam
0
 
LVL 5

Author Comment

by:viju2008
ID: 24058400
i logged in using sam  

and type but i want it only for a particular table not the whole DATABASE
0
Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

 
LVL 1

Expert Comment

by:hari_tailor
ID: 24058439
SO use DENY Statement
0
 
LVL 31

Accepted Solution

by:
RiteshShah earned 300 total points
ID: 24058442
USE [master]
GO
CREATE LOGIN [ForMe] WITH PASSWORD=N'temp123', DEFAULT_DATABASE=[AdventureWorks],
CHECK_EXPIRATION=OFF, CHECK_POLICY=OFF
GO

USE [AdventureWorks]
GO
CREATE USER [ForMe] FOR LOGIN [ForMe]
GO

GRANT SELECT ON emps TO ForMe

0
 
LVL 31

Expert Comment

by:RiteshShah
ID: 24058444
and yes deny for all other permission like

DENY INSERT,UPDATE,DELETE ON emps TO ForMe
0
 
LVL 31

Expert Comment

by:RiteshShah
ID: 24058501
finally this is for your [Login] table.
GRANT SELECT ON [LOGIN] TO Sam
 
DENY INSERT,UPDATE,DELETE ON [LOGIN] TO Sam

Open in new window

0

Featured Post

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Worried about if Apple can protect your documents, photos, and everything else that gets stored in iCloud? Read on to find out what Apple really uses to make things secure.
One of the biggest threats in the cyber realm pertains to advanced persistent threats (APTs). This paper is a compare and contrast of Russian and Chinese APT's.
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question