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 @ 5:30 PM
Points: 33,055, Visits: 15,167
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 @ 3:54 PM
Points: 604, Visits: 501
There are only 10 types of people in this world.

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


SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Today @ 3:07 PM
Points: 2,901, Visits: 2,921
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
SSChasing Mays

SSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing Mays

Group: General Forum Members
Last Login: Today @ 3:43 AM
Points: 625, Visits: 1,133
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


SSC Eights!

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

Group: General Forum Members
Last Login: Today @ 12:01 PM
Points: 840, Visits: 1,906
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


SSC Eights!

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

Group: General Forum Members
Last Login: Today @ 12:01 PM
Points: 840, Visits: 1,906
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: Tuesday, June 24, 2014 6:38 PM
Points: 1,371, Visits: 1,560
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


SSC-Insane

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

Group: General Forum Members
Last Login: Today @ 6:55 PM
Points: 21,204, Visits: 14,889
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 1, 2014 10:14 AM


SSCarpal Tunnel

SSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal Tunnel

Group: General Forum Members
Last Login: Today @ 4:00 PM
Points: 4,382, Visits: 3,392
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