Hi,
I have an Access 2003 FE connected to SQL Server 2005 backend. I want to
identify each row of tables against each users, so I add a column 'Owner'
and have a default value to (suser_sname()).
I add a test record and found that (suser_sname()) return Domain\username.
Is there a way to store only username in the column?
SF
Russell Fields - 24 Jul 2008 02:58 GMT
Depends on how you define your users, but if you strip the login's domain
component from the username, you could use user_name().
RLF
> Hi,
>
[quoted text clipped - 6 lines]
>
> SF
Erland Sommarskog - 24 Jul 2008 10:41 GMT
> I have an Access 2003 FE connected to SQL Server 2005 backend. I want to
> identify each row of tables against each users, so I add a column 'Owner'
> and have a default value to (suser_sname()).
>
> I add a test record and found that (suser_sname()) return Domain\username.
> Is there a way to store only username in the column?
Could use substring and charindex to strip out that part, but I don't
really see the point with it.

Signature
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx