Solved

access control in sql server

Posted on 2002-06-21
1
362 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

Backup Solution for AWS

Read about how CloudBerry Backup fully integrates your backups with Amazon S3 and Amazon Glacier to provide military-grade encryption and dramatically cut storage costs on any platform.

Question has a verified solution.

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

Suggested Solutions

Having an SQL database can be a big investment for a small company. Hardware, setup and of course, the price of software all add up to a big bill that some companies may not be able to absorb.  Luckily, there is a free version SQL Express, but does …
The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
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.
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

762 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