실행 : select erc_db.dbo.blankDelete('축 하 합 니 다 ') as text
create function blankDelete
(
@text nvarchar(1000)
)
returns nvarchar(1000)
as
begin
declare @tempText nvarchar(1000)
declare @i int
declare @textlen int
set @tempText = ''
set @i = 1
set @textlen = len(@text)
while(@i <= @textlen)
begin
if(substring(@text, @i, 1) != '')
begin
set @tempText = @tempText + substring(@text, @i, 1)
end
set @i = @i + 1
end
set @tempText = ltrim(rtrim(@tempText))
return @tempText
end
댓글 영역