Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase 123»»»

Binary Expand / Collapse
Author
Message
Posted Tuesday, December 31, 2013 8:53 PM


SSC-Dedicated

SSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-Dedicated

Group: Administrators
Last Login: Today @ 11:17 AM
Points: 32,827, Visits: 14,969
Comments posted to this topic are about the item Binary






Follow me on Twitter: @way0utwest

Forum Etiquette: How to post data/code on a forum to get the best help
Post #1526876
Posted Tuesday, December 31, 2013 8:54 PM


SSChasing Mays

SSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing Mays

Group: General Forum Members
Last Login: Monday, April 21, 2014 9:15 AM
Points: 604, Visits: 481
There are only 10 types of people in this world.

.
Post #1526877
Posted Wednesday, January 01, 2014 4:34 AM
SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Yesterday @ 2:18 PM
Points: 2,730, Visits: 2,649
Cool, in
11111011110
it was essential to spot that the first two bits (1) and the last one (0) are constructing the right answer.

Regards,
IgorMi
Post #1526897
Posted Wednesday, January 01, 2014 4:43 AM
SSC-Addicted

SSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-Addicted

Group: General Forum Members
Last Login: Today @ 7:30 AM
Points: 482, Visits: 842
Bill (DBAOnTheGo) (12/31/2013)
There are only 10 types of people in this world.

+10
Post #1526899
Posted Wednesday, January 01, 2014 6:25 AM


Say Hey Kid

Say Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey Kid

Group: General Forum Members
Last Login: Today @ 2:33 AM
Points: 673, Visits: 1,554
Awesome, thank you for the post, Steve.

HAPPY NEW YEAR 11111011110, to all SQL family (we are proud, as our family is growing bigger each day)

(I took the classic style, you know - pen paper and base-2)

-//Edit: Today I can proudly point back to my signature and say, I can be counter under "who understands binary"


ww; Raghu
--
There are only 10 types of people in the world, those who understand binary, and those who don't.

Note: (as of now) only.. 1 and 4 applies (i am on my way...)
Post #1526901
Posted Wednesday, January 01, 2014 6:28 AM


Say Hey Kid

Say Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey KidSay Hey Kid

Group: General Forum Members
Last Login: Today @ 2:33 AM
Points: 673, Visits: 1,554
Bill (DBAOnTheGo) (12/31/2013)
There are only 10 types of people in this world.


+1


ww; Raghu
--
There are only 10 types of people in the world, those who understand binary, and those who don't.

Note: (as of now) only.. 1 and 4 applies (i am on my way...)
Post #1526902
Posted Wednesday, January 01, 2014 6:35 AM
Mr or Mrs. 500

Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500

Group: General Forum Members
Last Login: Thursday, March 20, 2014 6:00 AM
Points: 588, Visits: 276
Steve, I love these questions. Thanks

Oh, here is an excerpt of a UDF I used to convert from int to binary (of course the other aspects of the UDF is checking the data type). I'm sure many of you use something similar or SQL Server bitwise ANDs. Just thought I'd share.

Thanks


--Convert to "binary"\HEX
select CONVERT(binary,2014), CONVERT(varbinary,2014)
--Returns 0x7DE...of course, the actual result between the two are different (fixed vs. variable)


--Convert string value to true binary representation
declare @parmVal int
declare @currVal varchar(64)
declare @counter int

set @parmVal=2014

select @counter = 64, @currVal = ''
while @counter>0
begin
select @currVal = convert(char(1), @parmVal % 2)+@currVal
select @parmVal = convert(int, (@parmVal / 2))
select @counter=@counter-1
end
select @currVal

--Returns 11111011110 (I left off the prepended 0's)


Post #1526903
Posted Wednesday, January 01, 2014 7:37 AM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Wednesday, April 09, 2014 2:46 AM
Points: 1,371, Visits: 1,547
Happy New Year friends!

~ Lokesh Vij

Guidelines for quicker answers on T-SQL question
Guidelines for answers on Performance questions

Link to my Blog Post --> www.SQLPathy.com

Follow me @Twitter

Post #1526906
Posted Wednesday, January 01, 2014 10:14 AM


SSC-Insane

SSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-Insane

Group: General Forum Members
Last Login: Today @ 11:20 AM
Points: 20,484, Visits: 14,140
Happy New Year



Jason AKA CirqueDeSQLeil
I have given a name to my pain...
MCM SQL Server


SQL RNNR

Posting Performance Based Questions - Gail Shaw
Posting Data Etiquette - Jeff Moden
Hidden RBAR - Jeff Moden
VLFs and the Tran Log - Kimberly Tripp
Post #1526921
Posted Wednesday, January 01, 2014 10:14 AM


SSCarpal Tunnel

SSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal Tunnel

Group: General Forum Members
Last Login: Today @ 10:52 AM
Points: 4,252, Visits: 3,335
For me it was an easy one - I used to work as a Systems Programmer on IBM mainframes...

Thanks, Steve, and Happy New Year, all!
Post #1526922
« Prev Topic | Next Topic »

Add to briefcase 123»»»

Permissions Expand / Collapse