alter proc prc_num @num bigint
as
declare @numstr varchar(50)
set @numstr=
while (@num<>0)
begin
set @numstr=@numstr+convert(char(1),@num%2)
set @num=@num/2
end
select reverse(@numstr)
exec prc_num 8
alter proc prc_num @num bigint
as
declare @numstr varchar(50)
set @numstr=
while (@num<>0)
begin
set @numstr=@numstr+convert(char(1),@num%2)
set @num=@num/2
end
select reverse(@numstr)
exec prc_num 8