• sqlbi.rahul (5/20/2010)


    try this

    SELECT REPLACE(SUSER_NAME(), HOST_NAME() , '\','') as userId

    i hope it works..

    i have mine setup as

    SELECT REPLACE(SUSER_NAME(), 'Dom-cs\','') as userId

    That will not work due to too many parameters passed to the replace function.

    Jason...AKA CirqueDeSQLeil
    _______________________________________________
    I have given a name to my pain...MCM SQL Server, MVP
    SQL RNNR
    Posting Performance Based Questions - Gail Shaw[/url]
    Learn Extended Events