Saturday, July 23, 2011

Selecting Database users

Selecting Database users


The following queries will be returning the user names

Select User

-- This displays the current user
Select User_Name()

Select Current_User

-- This displays the user belongint to ID 2
Select User_Name(2)

-- Displays all users for that DB
Select uid, name from sysusers order by uid

sysusers contain the information of all users

0 comments:

Post a Comment

Twitter Delicious Facebook Digg Stumbleupon Favorites More

 
Design by Deep's | Bloggerized by Deep - Deep's Templates | ElearSQL-Server