retry:
exec xxxxxxxxx
if @csvfilecount < 16
begin
waitfor delay '00:05:00'
goto retry
end
else
begin
send email
end
我喜欢使用go重试2次尝试然后去发送电子邮件。 不知道怎么做。请帮忙。感谢
答案 0 :(得分:0)
你可以使用带有计数器的while循环吗?
declare @counter as int
set @counter = 0
while @counter <= 2
begin
@counter = @counter + 1
-- your code here
-- update @csvfilecount
if @csvfilecount < 16
begin
waitfor delay '00:05:00'
end
else
begin
send email
-- do you want to BREAK here?
end
end