Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 

Convert binary SID to string

By Todd Engen, 2012/04/17

Functions such as SUSER_SID() return the binary represenation of the SID. fn_SIDToString converts the binary representation to the string format S-1-5-21-xxxx-yyyy-zzzz-aaaa.

Usage:

SELECT SUSER_NAME(), SUSER_SID(), dbo.fn_SIDToString(SUSER_SID())

Total article views: 2943 | Views in the last 30 days: 28
 
Related Articles
FORUM

SUSER_NAME() vs SUSER_SNAME()

Any reason to use one of the following over the other to return the user currently modifying data? ...

FORUM

SP4 Breaks Suser_sname() ?

Our admin folk just applied SQL 2000 SP4 on a W2K3 machine, and I noticed system function suser_sna...

FORUM

Execution Plan Caching and SUSER_NAME()

Hi, I've got a data warehouse which is effectively a star schema. However, one of the dimensions...

FORUM

Get User Name from suser_name() and host_name()

[code] SELECT REPLACE(SUSER_NAME(), HOST_NAME() + '\','') as userId [/code] I need to pull...

FORUM

Logon triggers - using EVENTDATA() versus system functions (SUSER_SNAME() etc.)

Which is the preferred way of writing a logon trigger for basic user authentication? Using the E...

Tags
security    
sid    
 
Contribute

Join the most active online SQL Server Community

SQL knowledge, delivered daily, free:

Email address:  

You make SSC a better place

As a member of SQLServerCentral, you get free access to loads of fresh content: thousands of articles and SQL scripts, a library of free eBooks, a weekly database news roundup, a great Q & A platform… And it’s our huge, buzzing community of SQL Server Professionals that makes it such a success.

Join us!

Steve Jones
Editor, SQLServerCentral.com

Already a member? Jump in:

Email address:   Password:   Remember me: Forgotten your password?
Steve Jones