Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Suser_Name returns different values? Server setting?

Status
Not open for further replies.

KJEE

Programmer
Jan 18, 2001
1
GB
Hi

An application is running using SQL Server 7 on NT on a number of different sites (each with their own SQL Server). The application makes use of SUSER_NAME to return the current user. Thing is, on some servers this return just the userlogin, while others return 'DOMAIN\userlogin'. This has serious consequences.

My question is: Is there a server setting that I can use to make sure that each server returns just the userlogin without the domain??

P.S. I know that SUSER_SNAME is recommended and that this returns DOMAIN\userlogin, but I would like to find a solution to the above problem first before revisting the application.

Thanks in advance

Karl Elisha
 
In my experiece, SUSER_NAME (or its companion, CURRENT_USER) returns Domain\User if that person connected using NT security (trusted connection), and LoginName if that person connected using standard security. Frustrating, I know. But at least from that you'll get the added bonus of knowing how they logged in.
Robert Bradley
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top