Remove All Spaces - Function
CREATE FUNCTION [dbo].[ufn_utl_RemoveAllSpaces]
(
@InputStr VARCHAR(8000)
)
RETURNS VARCHAR(8000)
AS
BEGIN
DECLARE @ResultStr VARCHAR(8000);
SET @ResultStr = @InputStr;
WHILE CHARINDEX(' ', @ResultStr) > 0
SET @ResultStr = REPLACE(@InputStr, ' ', '');
RETURN @ResultStr;
END;
GO
(
@InputStr VARCHAR(8000)
)
RETURNS VARCHAR(8000)
AS
BEGIN
DECLARE @ResultStr VARCHAR(8000);
SET @ResultStr = @InputStr;
WHILE CHARINDEX(' ', @ResultStr) > 0
SET @ResultStr = REPLACE(@InputStr, ' ', '');
RETURN @ResultStr;
END;
GO
Comments
Post a Comment