[dba-VB] True / false in SQL Server

Dan Waters df.waters at comcast.net
Mon Jan 16 11:21:52 CST 2012


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



More information about the dba-VB mailing list