[dba-VB] True / false in SQL Server

jwcolby jwcolby at colbyconsulting.com
Mon Jan 16 11:39:30 CST 2012


I used a bit type originally and it seemed to work, in fact that is what an Access upgrade 
translates to.  However I was warned by someone that trying to do compares was difficult due to the 
fact that they are packed.  I dunno.

I switched awhile back to using an int and that works well.

John W. Colby
Colby Consulting

Reality is what refuses to go away
when you do not believe in it

On 1/16/2012 12:21 PM, Dan Waters wrote:
> For Yes/No use a bit data type.  Also be sure to set Allow Null = False for
> all bit values, and select a default value (0 or -1).  And that's my
> experience talking! ;-)
>
> Dan
>
> -----Original Message-----
> From: dba-vb-bounces at databaseadvisors.com
> [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby
> Sent: Monday, January 16, 2012 11:09 AM
> To: VBA; Access Developers discussion and problem solving
> Subject: [dba-VB] True / false in SQL Server
>
> Because of various issues with bit and Access I have always used int as the
> data type and -1 or 0 as the default value.  These can be bound directly to
> a check box (for example).
>
> Because the default int is a 32 bit number I was just looking to see if I
> could use a smaller data type.  A smallint is 2 bytes and includes negative
> values.  A tinyint does not appear to allow -1.
> Is there a signed byte datatype that I am not seeing?
>
> --
> John W. Colby
> Colby Consulting
>
> Reality is what refuses to go away
> when you do not believe in it
>
> _______________________________________________
> dba-VB mailing list
> dba-VB at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/dba-vb
> http://www.databaseadvisors.com
>
> _______________________________________________
> dba-VB mailing list
> dba-VB at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/dba-vb
> http://www.databaseadvisors.com
>
>



More information about the dba-VB mailing list