anushakadiyala 52521 (12/17/2013)
Thank you for taking a look, This is the code I have been trying.UPDATE TA
SET ServerName= REPLACE(ServerName, '%.%.dim.com', '')
WHERE Servername like '%.%.dim.com%'
You cannot use wildcards in a REPLACE.
basically I want to remove anything that starts with first "."
The following should do as you ask... I don't know how you operate but I recommend not just blindly using this. Lookup the functions in Books Online (press the {f1} key in SSMS to get there) and teach yourself how they work and why. 😉
UPDATE dbo.TA
SET ServerName = SUBSTRING(ServerName,1,CHARINDEX('.',ServerName)-1)
WHERE ServerName LIKE '%.%'
;
--Jeff Moden
Change is inevitable... Change for the better is not.