[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

How to assign table level permisssions in SQL SERVER 2005

Posted on 2009-04-03
7
Medium Priority
?
805 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 9

Assisted Solution

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

Assisted Solution

by:hari_tailor
hari_tailor earned 400 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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 1

Expert Comment

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

Accepted Solution

by:
RiteshShah earned 1200 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

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

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

In this article, WatchGuard's Director of Security Strategy and Research Teri Radichel, takes a look at insider threats, the risk they can pose to your organization, and the best ways to defend against them.
This article covers the basics of data encryption, what it is, how it works, and why it's important. If you've ever wondered what goes on when you "encrypt" data, you can look here to build a good foundation for your personal learning.
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

650 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