Solved

access control in sql server

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

Edgartown IT Case Study

Learn about Edgartown's quest to ensure the safety and security of the entire town's employee and citizen data. Read the case study!

Question has a verified solution.

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

Suggested Solutions

Let's review the features of new SQL Server 2012 (Denali CTP3). It listed as below: PERCENT_RANK(): PERCENT_RANK() function will returns the percentage value of rank of the values among its group. PERCENT_RANK() function value always in be…
I have a large data set and a SSIS package. How can I load this file in multi threading?
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.
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.

751 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