输入变量@word VARCHAR(20)@times INT输出变量VARCHAR(100)运行效果演示
1 回答
红颜莎娜
TA贡献1842条经验 获得超12个赞
CREATE function dbo.Repeat(@key as varchar(256),@number as int)
returns varchar(max)
as
begin
declare @char varchar(max)
set @char = ''
while (@number>0 )
begin
select @char = @char+@key
set @number = @number -1
end
return @char
end
添加回答
举报
0/150
提交
取消