Home All Groups Group Topic Archive Search About

Access Yes/No field equivalent in Sql Server

Author
15 Sep 2005 3:31 PM
Jack
Hi,
I am building a table in sql server. One of the field is equivalent to
Access yes/no field. This will have values Yes or No obtained from a form in
Asp page. I am wonering what would be the correct datatype for this field.
Thanks.

Author
15 Sep 2005 3:38 PM
Raymond D'Anjou
char(1) - "y" or "n"
varchar(3) - "yes" or "no"

Show quote
"Jack" <J***@discussions.microsoft.com> wrote in message
news:EAF7A165-2386-442D-881C-775B3C161473@microsoft.com...
> Hi,
> I am building a table in sql server. One of the field is equivalent to
> Access yes/no field. This will have values Yes or No obtained from a form
> in
> Asp page. I am wonering what would be the correct datatype for this field.
> Thanks.
Author
15 Sep 2005 3:40 PM
Jerry Spivey
Jack,

You could use a bit datatype with support for 0 or 1 then translate that to
Yes or No in code.  You could also use a char(3) with a check contraint
limiting the valid entries to Yes/No.  A default constratint can be added as
well for a default of Yes or No when a user does not explicitly enter a
value.

HTH

Jerry
Show quote
"Jack" <J***@discussions.microsoft.com> wrote in message
news:EAF7A165-2386-442D-881C-775B3C161473@microsoft.com...
> Hi,
> I am building a table in sql server. One of the field is equivalent to
> Access yes/no field. This will have values Yes or No obtained from a form
> in
> Asp page. I am wonering what would be the correct datatype for this field.
> Thanks.
Author
15 Sep 2005 3:42 PM
Perayu
You may consider using Bit for boolean data type in Presentation layer.

Perayu

Show quote
"Jack" <J***@discussions.microsoft.com> wrote in message
news:EAF7A165-2386-442D-881C-775B3C161473@microsoft.com...
> Hi,
> I am building a table in sql server. One of the field is equivalent to
> Access yes/no field. This will have values Yes or No obtained from a form
> in
> Asp page. I am wonering what would be the correct datatype for this field.
> Thanks.
Author
15 Sep 2005 3:56 PM
Jack
Thanks for all the help from Raymond, Jerry and Perayu. I appreciate it.

Show quote
"Perayu" wrote:

> You may consider using Bit for boolean data type in Presentation layer.
>
> Perayu
>
> "Jack" <J***@discussions.microsoft.com> wrote in message
> news:EAF7A165-2386-442D-881C-775B3C161473@microsoft.com...
> > Hi,
> > I am building a table in sql server. One of the field is equivalent to
> > Access yes/no field. This will have values Yes or No obtained from a form
> > in
> > Asp page. I am wonering what would be the correct datatype for this field.
> > Thanks.
>
>
>

AddThis Social Bookmark Button