Bit Or Varchar
I just took over a sql server 2008 database, and in multiple database tables the designer used a varchar(50) column to hold a Yes/No value.  Maybe it is just me, but wouldnt it make more sense to have used a bit column since the ONLY value used was a Yes/No?
September 7th, 2015 2:47pm

Yes, if the column is logical (Yes/No, true/false, 1/0), then you should use bit type for that column.
Free Windows Admin Tool Kit Click here and download it now
September 7th, 2015 2:52pm

>> The designer used a VARCHAR(50) column to hold a Yes/No value.  Maybe it is just me, but wouldnt it make more sense to have used a BIT column since the ONLY value used was a Yes/No? << 


RDBMS is based on predicates and not assembly language flags. The VARCHAR(50) is a leftover from ACCESS and other Microsoft defaults from the 1970's software.  Your system was not designed; it just happened by accident :( 

What you have is not legacy code; it is family curse code. You need to re-write just about everything, starting with the DDL. Trust me; I have earned a living repairing this stuff for three deca
September 7th, 2015 5:33pm

Bad answer. Did you know that BIT is a proprietary numeric data type in T-SQL? the BIT data type should never be used. 
Free Windows Admin Tool Kit Click here and download it now
September 7th, 2015 5:35pm

Do you mean you never use any flags in your tables? Say, active or Hidden flag?
September 7th, 2015 5:46pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics