Function to display integer as binary string

  • Jonathan AC Roberts

    SSCoach

    Points: 16880

    Comments posted to this topic are about the item Function to display integer as binary string

  • akljfhnlaflkj

    SSC Guru

    Points: 76202

    We used to use tricks to store true/false values for variables in each position. But this was when storage was a premium. We haven't done that in years. Still, nice script.

  • rob.lobbe-964963

    Old Hand

    Points: 307

    try master.sys.fn_varbintohexstr( cast(int-value as varbinary(max)) )

  • Jonathan AC Roberts

    SSCoach

    Points: 16880

    rob.lobbe-964963 (4/29/2015)


    try master.sys.fn_varbintohexstr( cast(int-value as varbinary(max)) )

    To do what?

  • rob.lobbe-964963

    Old Hand

    Points: 307

    To use a system function that already does what you have coded.

  • Jonathan AC Roberts

    SSCoach

    Points: 16880

    rob.lobbe-964963 (4/30/2015)


    To use a system function that already does what you have coded.

    But it doesn't do the same thing. The function I wrote displays the value of an int in its binary form, i.e. as ones and zeros.

Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic. Login to reply