This functions are used to convert integers/numbers into binary format and viceversa.
After creating functions check this out....
select dbo.fn_generate_binary_frominteger(310)
select dbo.fn_generate_integer_frombinary(100110110)
Regards,
Vignesh Arulmani