Find Current User Information

SELECT spid, uid=rtrim(loginame), Program_name=rtrim(Program_name),
dbname=db_name(dbid), status=rtrim(status) FROM master.dbo.sysprocesses
WHERE loginame = 'UserName';


You can also use sp_who command to see all users associated with current database.

No comments: