二进制|十进制|转换
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
时间: 2024-10-29 14:15:21
二进制|十进制|转换
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