declare
@mx_number bigint,
@num bigint,
@userId varchar(50);
drop table if exists #tt_usif_numb;
select
ui.id,
row_number() over(order by ui.id) user_num
into #tt_usif_numb
from
axp.UserInfo ui;
set @mx_number = (select max(user_num) from #tt_usif_numb);
set @num = dbo.getRandIntUp(@mx_number)
select @num
select *
from #tt_usif_numb u
where
u.user_num =
@num
select *
from #tt_usif_numb u
where
u.user_num =
dbo.getRandIntUp(@mx_number)