• ScottPletcher (11/20/2012)


    select PARSENAME(left(email, charindex('@', email) - 1), 1) + '.' + PARSENAME(left(email, charindex('@', email) - 1), 2) +

    substring(email, charindex('@', email), len(email))

    from (

    select 'Doe.John@CompanyABC.com' as email

    ) as test_table

    Just to note: PARSENAME is elegant but not the best performer...

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]