Pages

Saturday, September 27, 2008

User Details in SQL Server

In next couple of posts i will explain about some very usefull stored procedures in SQL Server.

SP_HELPUSER: SP_HELPUSER [NAME_OF_USER]

The sp_helpuser stored procedure is used to display the user(s) and role(s) present in a database based on the input. Name of the user is optional filed; if you pass a specific user then it displays information, such as user name, login name, group name, default database, user ID, and sid of the user. The procedure displays information about the current database user if no parameter is passed.

EXEC sp_helpuser

The above stored procedure is used to display all the users in the current database.

No comments: