Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase 123»»»

Bit by bit Expand / Collapse
Author
Message
Posted Wednesday, January 27, 2010 8:12 PM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Thursday, May 27, 2010 1:31 PM
Points: 132, Visits: 101
Comments posted to this topic are about the item Bit by bit
Post #854871
Posted Wednesday, January 27, 2010 8:13 PM
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: Wednesday, January 6, 2016 1:49 PM
Points: 3,925, Visits: 1,619
Easy one.

SQL DBA.
Post #854872
Posted Wednesday, January 27, 2010 8:29 PM


SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Tuesday, October 18, 2016 8:46 PM
Points: 2,333, Visits: 3,896
Good question. Tests the basic

M&M
Post #854878
Posted Wednesday, January 27, 2010 10:07 PM


SSChasing Mays

SSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing MaysSSChasing Mays

Group: General Forum Members
Last Login: Friday, January 11, 2013 12:41 PM
Points: 621, Visits: 297
Points for taking ...



Bhavesh Patel

http://bhaveshgpatel.wordpress.com/
Post #854900
Posted Wednesday, January 27, 2010 10:10 PM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Today @ 7:29 AM
Points: 5,911, Visits: 10,367
Bhavesh_Patel (1/27/2010)
Points for taking ...

Makes up for yesterdays (though points were awarded anyway...)


Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
If you can't explain to another person how the code that you're copying from the internet works, then DON'T USE IT on a production system! After all, you will be the one supporting it!
Links: For better assistance in answering your questions, How to ask a question, Performance Problems, Common date/time routines,
CROSS-TABS and PIVOT tables Part 1 & Part 2, Using APPLY Part 1 & Part 2, Splitting Delimited Strings
Post #854901
Posted Wednesday, January 27, 2010 10:16 PM


SSC-Insane

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

Group: General Forum Members
Last Login: Monday, November 21, 2016 11:03 AM
Points: 20,009, Visits: 18,255
Thanks for the question.



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


SQL RNNR

Posting Performance Based Questions - Gail Shaw
Post #854905
Posted Wednesday, January 27, 2010 11:08 PM
SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Tuesday, April 19, 2016 5:42 AM
Points: 2,825, Visits: 374
easy one
Post #854932
Posted Thursday, January 28, 2010 2:05 AM
SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Wednesday, November 30, 2016 2:06 AM
Points: 2,251, Visits: 8,029
"if a number larger than one is used, it is converted to one."

I thought the actual explanation was that anything other than 0 (false) is treated as true and hence is stored as 1. So a number larger than 1 becomes 1, but so does any number less than 1, apart from 0.
Post #854994
Posted Thursday, January 28, 2010 2:19 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: Wednesday, November 23, 2016 2:20 AM
Points: 928, Visits: 786
OK. I am in the 17% who got it wrong - I replied "Error". And now I know. But will somebody kindly explain why BIT is treated any differently to TINYINT, SMALLINT, INT, etc. It is, after all, only a type that has a range of valid values. If the others report an overflow error when I try to assign values outside their permitted range, why not BIT also?
Post #855002
Posted Thursday, January 28, 2010 2:32 AM
SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Wednesday, November 30, 2016 2:06 AM
Points: 2,251, Visits: 8,029
Here's a slightly better reference
http://msdn.microsoft.com/en-us/library/ms191530(SQL.90).aspx#_bit

"Converting to bit promotes any nonzero value to 1"
Post #855012
« Prev Topic | Next Topic »

Add to briefcase 123»»»

Permissions Expand / Collapse