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 @ 7:12 AM
Points: 31,284, Visits: 15,746
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: Today @ 8:50 AM
Points: 611, Visits: 515
There are only 10 types of people in this world.

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


Hall of Fame

Hall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of Fame

Group: General Forum Members
Last Login: Today @ 5:36 AM
Points: 3,076, Visits: 3,193
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




Igor Micev,
SQL Server developer at Seavus
www.seavus.com
Post #1526897
Posted Wednesday, January 1, 2014 4:43 AM
SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: Yesterday @ 3:06 AM
Points: 827, Visits: 1,465
Bill (DBAOnTheGo) (12/31/2013)
There are only 10 types of people in this world.

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


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Today @ 10:33 AM
Points: 1,030, Visits: 2,338
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
--
The first and the hardest SQL statement I have wrote- "select * from customers" - and I was happy and felt smart.
Post #1526901
Posted Wednesday, January 1, 2014 6:28 AM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

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


+1


ww; Raghu
--
The first and the hardest SQL statement I have wrote- "select * from customers" - and I was happy and felt smart.
Post #1526902
Posted Wednesday, January 1, 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 1, 2014 7:37 AM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Thursday, October 16, 2014 10:02 AM
Points: 1,372, Visits: 1,566
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 1, 2014 10:14 AM


SSCoach

SSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoach

Group: General Forum Members
Last Login: Today @ 2:31 PM
Points: 17,963, Visits: 15,965
Happy New Year



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


SQL RNNR

Posting Performance Based Questions - Gail Shaw
Post #1526921
Posted Wednesday, January 1, 2014 10:14 AM


SSCarpal Tunnel

SSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal Tunnel

Group: General Forum Members
Last Login: Friday, October 24, 2014 12:43 PM
Points: 4,126, Visits: 3,428
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