Windows Logins Basics

As most people would agree, Windows Authentication is the preferred authentication method in SQL Server as it provides consistency with your Windows or AD administration and it allows you to use groups for ease of administration if your users are organized into groups by security level and function.

To create a login in T-SQL use the following code:

CREATE LOGIN ‘AD\Ed’

To remove a login using T-SQL, use the following code:

DROP LOGIN ‘AD\Ed’

To deny a login using T-SQL, use the following code (NOTE: if the user or group does not exist in SQL Server, this command will add them first): 

 DENY CONNECT ‘AD\Ed’

This is a good foundation for a couple of other posts that I am working on for this week.  Enjoy!

Advertisement

About SQLGator

Microsoft Data Platform MVP, Florida Gator, Star Wars fanatic and is there anything else...oh yeah PS4! I am a geek and SQL Server Business Intelligence Consultant, there are other technologies greater than these? Not so fast my friend! I also love to travel to new and exotic places.

Posted on January 30, 2012, in Security and tagged , . Bookmark the permalink. Leave a comment.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: