Advertisement
Guest User

Aredna #130 Easy Golf

a guest
Jun 18th, 2013
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. declare @i nvarchar(9) = '2d100'
  2. ;with p as(select left(@i,charindex('d',@i)-1)m,cast(substring(@i,charindex('d',@i)+1,9) as int)d)
  3. ,r as(select 1 n,cast(crypt_gen_random(2)%d+1 as nvarchar(max))r from p union all select n+1,cast(
  4. r+' '+cast(crypt_gen_random(2)%d+1 as nvarchar(max))as nvarchar(max))from r,p where n<m)select r
  5. from r,p where n=m
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement