I have a column name called Username in my table in SQL Server 2008.
Username has following data
Username
corp\abc
corp\petern
corp\timw
and so on
I need my Username to be
Username
abc
petern
timw
how do I parse the data in Username to skip corp\ ?
Thanks.
You could use PARSENAME to split the data but the function uses dot (
.) as the delimiter. So, you have to first replace the backward slashes (\) with period or dot (.).Click here to view the demo in SQL Fiddle.
Script:
Output: