把6个1转成2进制是多少?
在SLQ把6个1转成2进制是多少?
[解决办法]
--十进制转二进制函数create function dbo.inttobit (@number int)returns varchar(100)asbegin declare @i int declare @j float declare @m int declare @out1 varchar(1) declare @out2 varchar(20) set @i=@number set @out2=' ' while @i>=1 begin set @j=@i/2 set @m=@i%2 set @i=floor(@j) set @out1=cast(@m as char(1)) set @out2=@out1+@out2 end return @out2endselect dbo.inttobit(111111)/*11011001000000111 */