Oj @abrakadaber ale ty jesteś ja akurat uważam to za ciekawe zadanie i chętnie mu gotowca zrobiłem :)
declare
@cnt INT = 0,
@ktoreLiteryCount int = 0,
@ileLiter INT = 0,
@ktoraLitera int = 0,
@s varchar(max),
@sModify varchar(max);
declare
@T table (s varchar(255));
set @s = 'Jak będzie dziś ładna pogoda to pójdę pograć w piłkę a jak będzie padać deszcz to poczytam książkę';
WHILE @cnt < 1000 --tu tylko sobie zmień rozmiar
BEGIN
set @ileLiter = FLOOR(RAND()*97)+1;
set @sModify = @s;
set @ktoreLiteryCount = 0;
while @ktoreLiteryCount < @ileLiter
begin
set @ktoraLitera = FLOOR(RAND()*97)+1;
set @sModify = SUBSTRING(@sModify, 1, @ktoraLitera -1) +
UPPER(SUBSTRING(@sModify,@ktoraLitera,1)) +
SUBSTRING(@sModify,@ktoraLitera+1,98 - @ktoraLitera+1);
set @ktoreLiteryCount = @ktoreLiteryCount + 1;
end;
insert into @T (s) values (@sModify)
SET @cnt = @cnt + 1;
END;
select * from @T