create function fn_get_ext
(
@filename varchar(8000),
@upper int
)
returns varchar(12)
as
begin
declare @rslt varchar(12)
if(@filename is not null)
begin
if(charindex('.', @filename) > 0)
begin
set @rslt = right(@filename, charindex('.', reverse(@filename))-1)
end
else
begin
set @rslt = ''
end
end
else
begin
set @rslt = ''
end
if(@upper = 1)
set @rslt = upper(@rslt)
return @rslt
end
select cafe_manage.dbo.fn_get_ext('', 1)
댓글 영역