quote:
Originally posted by visakh16
SELECT PARSENAME(REPLACE(col,'*','.'),1)
------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
PARSENAME is less reliable than th emethod I posted. Both the examples shown below will return inocrrect results if you use parsenameSELECT PARSENAME(REPLACE('abc*x.yz','*','.'),1)
SELECT PARSENAME(REPLACE('abc[d*e]xyz','*','.'),1)