Solved

access control in sql server

Posted on 2002-06-21
1
375 Views
Last Modified: 2012-06-27
I currently doing an assignment on mandatory access control, which can grant access permission to user based on tables,rows or column.

Izzit possible i implement the madatory access control in ms sql server? I suspect it is the "grant" command?
0
Comment
Question by:cialat
[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
1 Comment
 
LVL 5

Accepted Solution

by:
spcmnspff earned 70 total points
ID: 7099147
Before you do a grant you have to make sure there is a login on the server for the user and that user is added to the currentdb.  In the current database issue these commands before the grant:

-- Check for the login
If Not Exists(Select * from Master.dbo.Syslogins Where name = 'LoginName')
sp_addlogin  @loginame =  'login'
     ,  @passwd =  'password'  
     ,  @defdb =  'defaultdatabase'  

-- Check for the database user
If Not Exists(Select * From Sysusers U Join Master.dbo.SysLogins L ON U.SID = L.SID WHERE L.Name = 'LoginName')
sp_adduser @loginame =  'login'

--Now use the grant command, in the current database:
Grant Select, Insert, Update, Delete ON Object to login
0

Featured Post

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…

617 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