1
, пожалуйста, помогите мне в этом, как бы я сделал какое-то рекурсивное заявление в моей хранимой процедуре. вот что я хочуmssql генерируя уникальный код
-- @requestcode will genereate some random string i have already the code below
set @requestcode = (SELECT substring(@username,0,3)+'-'+SUBSTRING(CONVERT(varchar(255), NEWID()), 0, 9))
-- then i want to check if the string generated is existing to 'sampletable'
select @requestcode from sampletable
-- if it is existing back to the @requestcode query until it is not existing
заранее спасибо