My Favorite MS-SQL Snippets

Favourite MS-SQL Snippets

How to use Replace()

SELECT REPLACE ([sz_Email], '#','@') AS sz_Email_Fixed
FROM [MyMy].[dbo].[Clients]
WHERE 1=1 AND [sz_Email] LIKE '%#%'

or 

UPDATE  MyTable
SET SZ_EMAIL = REPLACE ([SZ_EMAIL], '#','@') 
WHERE 1=1
AND
ID=39494
 




CachedSince:{ts '2024-11-21 00:40:45'}