'user_name()' funtion returns domain as well
Posted on 2003-11-21
I have set of logins and users for a database who all inherit permissions from a Windows group.
When a user takes a record, a field called '[UName]' is populated. I have set the default value of this field to the function 'user_name()' to get the value into the field.
I do not want any of the logins, database access permissions of their own as they automatically inherit from the Windows Group. However if I take all db permissions away and rely on the group permissions, 'user_name()' returns 'mydomain/harry' instead of just 'harry'.
I would like to return just the username without the domain. Is there another command that will do this for me or will I have to resort to string manipulation?