Results 1 to 6 of 6
  1. #1
    Join Date
    Dec 2002
    Location
    Washington D.C.
    Posts
    164

    Unanswered: Equvilant of Yes/No from Access in SQL

    What is the wquvilant data type of Yes/No from access in SQL Server?
    is it "binary"?

    Thanks

  2. #2
    Join Date
    Feb 2002
    Location
    Houston, TX
    Posts
    809
    yes, with the caveat that a variable or table attribute could hold 0, 1, or null!
    Paul Young
    (Knowledge is power! Get some!)

  3. #3
    Join Date
    Dec 2002
    Posts
    1,245

    Re: Equvilant of Yes/No from Access in SQL

    Uh, actually, I think the data type that you are looking for is "Bit". A Bit can be 0, 1 or null.

    "Binary" according to SQL BOL is a "Fixed-length binary data with a maximum length of 8,000 bytes."

    Just note that in MS Access, the actual value of the Yes/No field is:

    Yes = -1
    No = 0

    Whereas the Bit data type in SQL Server is simply 1 or 0 (there is no Yes/No equivalency). Depending on how you design your front-end, the results that you get may not be what you expected.

    Regards,

    Hugh Scott

    Originally posted by Sia
    What is the wquvilant data type of Yes/No from access in SQL Server?
    is it "binary"?

    Thanks

  4. #4
    Join Date
    Feb 2002
    Location
    Houston, TX
    Posts
    809
    bit is functionaly the same as binary or binary(1), but you are right bit is the correct choice here as it would use 4 less bytes to store
    Paul Young
    (Knowledge is power! Get some!)

  5. #5
    Join Date
    Feb 2003
    Location
    Montreal, Canada
    Posts
    117

    Re: Equvilant of Yes/No from Access in SQL

    hmscott is definitly right

    Originally posted by Sia
    What is the wquvilant data type of Yes/No from access in SQL Server?
    is it "binary"?

    Thanks
    Steve

  6. #6
    Join Date
    Dec 2002
    Location
    Washington D.C.
    Posts
    164

    Re: Equvilant of Yes/No from Access in SQL

    Thank You all


    Originally posted by dbadelphes
    hmscott is definitly right

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •