SQL snippets: Difference between revisions
Jump to navigation
Jump to search
Hoppinglife (talk | contribs) Created page with "<syntaxhighlight> with randowvalues as( select 1 id, CAST(RAND(CHECKSUM(NEWID()))*100 as int) randomnumber union all select id + 1, CAST(RAND(CHECK..." |
Hoppinglife (talk | contribs) No edit summary |
||
| Line 11: | Line 11: | ||
select * from randowvalues OPTION(MAXRECURSION 0); | select * from randowvalues OPTION(MAXRECURSION 0); | ||
</syntaxhighlight> | |||
<syntaxhighlight> | |||
</syntaxhighlight> | </syntaxhighlight> | ||
Latest revision as of 17:29, 16 June 2021
with randowvalues
as(
select 1 id, CAST(RAND(CHECKSUM(NEWID()))*100 as int) randomnumber
union all
select id + 1, CAST(RAND(CHECKSUM(NEWID()))*100 as int) randomnumber
from randowvalues
where
id < 1000
)
select * from randowvalues OPTION(MAXRECURSION 0);