日期:2013-12-09  浏览次数:20394 次

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