iSnare.com - Free Content Articles Directory
Authors Contents [Advanced Search][Add OpenSearch][Job Search]
Distribute your articles to thousands of article sites for only $2 and below! Read more...

Index  Computers and Technology
 

SQL Server Security

 
[ Contact the Author] [ Send to a Friend] [ Article Publisher] [Make PDF] [ Print] [ Bookmark & Share]
 
Read our Terms of Service before reprinting this article. The submitter specified above has claimed the rights to this article.
Chris Kemp

There are several levels of security to SQL Server. At the a base level, in order to be granted get access to a SQL Server, a user is required to have a login account.

There are two modes of security to SQL Server, distinguished by which program provides the authentication. NT Authentication provides that Windows NT (and/or its successors) verify verifies the identity of a user logging in. In this mode, the SQL Server will ‘trust' that Windows NT has verified that the user is who he says he is. The second method, SQL Server authentication, it is SQL: Server that authenticates the identity of the user. SQL Server authentication is typically used for internet Internet connections, since not all internet Internet users have Windows NT, and not all NT domains are trusted.

In addition to identifying users, it is sometimes convenient to define roles at the server level. Since within an organization, there are groups of users with similar access needs and levels, it may be convenient to define roles with specific levels of permissions. Once you have defined a role, you can assign users to that role, and those users inherit all of the privileges assigned to the role.

There are two types of permissions assigned to individual users and roles. Statement permissions confer the right to execute certain types of T-SQL commands. Object permissions confer the right to access database objects directly.

Defining Logins Users, and Roles

Logins can be added either through the Database Properties Window (under Logins), or by invoking system stored procedures with appropriate parameters. The command

sp_addlogin loginname, password, databasename

will add a SQL Server authenticated login to the list;

sp_grantlogin ‘domainname/username'

will add an NT authenticated login to the list.

After the login has been allowed, you need to allow the user access to the database. This is done either through the Database Properties Window (under Users for that particular database) or with the command

sp_grantdbaccess loginname.

You can see the list of users using the command sp_helpuser or sp_helpuser username

To cancel a security account for a given database, use sp_revokedbaccess username

To remove an NT Login use sp_revokelogin ‘username' (note no domain), and to srop stop a SQL Server authenticated login, use sp_droplogin username .

To add a role to a database, use sp_addrole ‘clerical', and to add meAugust 16, 2005er ‘clerical', ‘username'. To delete a rolemember use sp_droprolemember username.

At the SQL Server level the rolenames are fixed, and cannot be changed, but users can be added using sp_addsrvrolemember username, dbcreator . To drop a rolmember, use sp_dropsrvmember username .

Granting permissions

The GRANT command is used to assign permissions to a security account. Statement permissions in this way: GRANT right TO username

where right can be any of the following:

CREATE DATABASE
CREATE DEFAULT
CREATE PROCEDURE
CREATE RULE
CREATE TABLE
CREATE VIEW
DUMP DATABASE
DUMP TRANSACTION

For object permissions, GRANT is also the command to use, but the grammar differs slightly:

GRANT action ON table/view/procedure name TO username

where action can be one of the following:

INSERT, DELETE, EXECUTE, SELECT or UPDATE

One can also apply these this permission to groups or roles as well as usernames. And it is also possible that a role can have a permission, but a member of that role be denied permission for a task. See the next discussion.

In all of the above commands, you can also explicitly deny permission using DENY in place of GRANT. Note however that DENY is not the negation of GRANT . DENY explicitly excludes the user from that capability. The REVOKE command is used to remove both the permission and refusal.

Resources

• Article: How To Identify Your SQL Server Service Pack Version and Edition
This is an insightful article that discusses about SQL server pack version and edition.

• Tutorial: Using Access or SQL Server to Write your ASP Code
This tutorial discusses how SQL server can be used to write the ASP code.

Important NoticeDISCLAIMER: All information, content, and data in this article are sole opinions and/or findings of the individual user or organization that registered and submitted this article at Isnare.com without any fee. The article is strictly for educational or entertainment purposes only and should not be used in any way, implemented or applied without consultation from a professional. We at Isnare.com do not, in anyway, contribute or include our own findings, facts and opinions in any articles presented in this site. Publishing this article does not constitute Isnare.com's support or sponsorship for this article. Isnare.com is an article publishing service. Please read our Terms of Service for more information.

Chris is a well known author in the field of Information Technology. His articles are very popular and well known in the various article banks across internet. His popular articles are about SQL Server, Database Design, IT Consulting and Software Development. Metro NY / NJ SQL Server Consultants We specialize is custom database software. Call us for a free consultation (973) 635 0080 or email us at paladn.com
Article Tags: server [See Dictionary], sql [See Dictionary], users [See Dictionary]
Got a question about this article? Ask the community!
Article published on February 01, 2006 at Isnare.com
 
Rate this article:

SQL Server System Stored Procedures
Submitted by: Chris Kemp

System Stored Procedures System stored procedures are packaged with SQL Server Many procedures are used to administer SQL Server, but some are utilities that can be profitablly used by developers...

SQL Server 2000 Data Types
Submitted by: Chris Kemp

SQL Server requires that each variable and column in a table should be defined with respect to the type of data it will store...

SQL Server Triggers
Submitted by: Chris Kemp

Triggers are stored procedures which are fired when data is modified in an underlying table They can evaluate data being added to a table for validation purposes, or can make changes in that or other fields depending on the value of that data...

It’s a Mod Chip World!
Submitted by: Michiel Van Kets

No Nintendo Wii game console seems complete without a mod chip installation and with today’s latest mod chip innovations it’s easier than ever to buy and install your own Wii modification chip...

Be Careful When Buying Cheap Adobe Software
Submitted by: Adrianna Noton

When individuals are looking to buy software they always love finding cheap Adobe software However are these really great prices too good to be true...

What is the Difference Between Standard and High Yield Toner Cartridges?
Submitted by: Adriana N

There have been improvements in the manufacturing of printer toner cartridges Toner found in a cartridge is dry powder blended with a polymer that sticks on to the paper as printing takes place...

IPod Battery Guide For Your IPod Nano
Submitted by: Brian H Logan

iPod battery life is an issue to most iPod users The iPod battery weakens over a period of time and it is not easily replaced...

Factors in Selecting a VAR
Submitted by: Lawrence Reaves

Selecting a Value Added reseller (VAR) is crucial and requires pain-staking assessment of their capabilities and track record, including those who are already delivering services into a client, even when the relationship has subsisted for many years...

IDC Market Forecast Predicts Static it Spend to 2013
Submitted by: Lawrence Reaves

An IDC Market Analysis and Forecast for 2009-2013 has been released and the results demonstrate a modest increase in IT spend by SMB’s worldwide – gross IT spend is predicted to rise by a mere 5...

VAR Issues – “Cheap” Usually Means Scalability, Service, And Reliability Are Sacrificed
Submitted by: Shell Harris

Value Added Resellers (VAR’s) come in all flavors, shapes and sizes – they provide a vital service to IT departments who are suffering from severe budgetary constraints, staff and skill shortages and issues in implementing and managing increasingly complex solutions...

Why You Should Buy a Notebook
Submitted by: Roberto Sedycias

The notebook computer is quickly replacing the desktop as most computer owner's favorite machine Not only is it portable for travel, it is also portable for use in the home...

The Clear Advantages Of A Sony Ericsson Satio
Submitted by: Gordon Millisons

Sony Ericsson Satio is a smart phone available at phone shops today with huge support for multimedia, touch screen feature and a lot more...

Did Windows 7 Boom or Bust?
Submitted by: John Dow

It's been a few weeks now since the launch of the Windows 7 release by Microsoft The launch in general was much lower key than past version launches, probably for a couple of reasons...

GBC H312 Laminator Review
Submitted by: Jeff McRitchie

The H312 replaces the H310 in the GBC HeatSeal line of pouch laminators Like its predecessor, this machine is targeted toward small business or home offices that do light to moderate amounts of laminating and need the flexibility to process larger documents...

GBC HeatSeal H435 Laminator Review
Submitted by: Jeff McRitchie

A new addition to GBC's Jam Free line of laminators, the HeatSeal H435 is presented as a laminating solution for small to medium sized organizations that need the flexibility of being able to laminate documents of many sizes, and of thicknesses up to 7mil...

GBC HeatSeal H520 Laminator Review
Submitted by: Jeff McRitchie

Aimed at the medium to large office market, the GBC HeatSeal H520 is designed as a solution for organizations that need to laminate documents of many different sizes...

GBC HeatSeal H535 Turbo Laminator Review
Submitted by: Jeff McRitchie

It is no secret that in today's business world, it's vital to produce top-notch work quickly That is hard to do that when you're waiting around for your laminator to work...

GBC ProClick P50 Binding Punch Review
Submitted by: Jeff McRitchie

As one of the premier manufacturers of binding machines, GBC produces machines both large and small for a wide range of uses...

Isnare.com Footer Divider

© 2004-2009. Isnare Free Articles - An Isnare Online Technologies Free Articles Project. All Rights Reserved.   Privacy Policy