CREATE FUNCTION dbo.MyFunction (@input VARCHAR(200)) RETURNS VARCHAR(200) AS BEGIN DECLARE @WebSite VARCHAR(250) SET @WebSite = @Input SET @WebSite = REPLACE(@WebSite , 'https://', '') SET @WebSite = REPLACE(@WebSite , 'http://', '') SET @WebSite = REPLACE(@WebSite , '.com', '') SET @WebSite = REPLACE(@WebSite , 'www.', '') RETURN @WebSite END