May 22, 2003 at 3:40 pm
what filed in sql server table is like yes/no
in access
so i can insert the value yes/no to table in sql server
thnks ilan
May 22, 2003 at 3:42 pm
I would use a BIT field (1/0).
You can use a Varchar(3) or CHAR(3) and insert Yes / No.
Useing a CHAR(3) will "waste" space as it'll pad the right with a space when you have a no.
Bit is the best option.
Cheers,
Crispin
Cheers,CrispinI can't die, there are too many people who still have to meet me!It's not a bug, SQL just misunderstood me!
May 23, 2003 at 1:05 am
Hi midan1,
I think the equivalent to yes/no in Access is a BIT field. You could also use a INT field. If you decide to use a BIT field don't forget to set the default value to 0 or 1. That wa a tricky pitfall when I move from Access to SQL Server
Cheers,
Frank
--
Frank Kalis
Microsoft SQL Server MVP
Webmaster: http://www.insidesql.org/blogs
My blog: http://www.insidesql.org/blogs/frankkalis/[/url]
May 23, 2003 at 6:57 am
Use the BIT datatype. SQL Server will fit up to 8 BIT fields in the space of a single byte. It handles NULL values in a separate BITMASK field, but unless you expect a "Maybe" value, it is advisable, as perviously mentioned, to set a default of zero or one.
May 23, 2003 at 7:01 am
Any reasons why a SQL Server BIT value of 1 is displayed in an Access db as -1 ?
Cheers,
Frank
--
Frank Kalis
Microsoft SQL Server MVP
Webmaster: http://www.insidesql.org/blogs
My blog: http://www.insidesql.org/blogs/frankkalis/[/url]
May 23, 2003 at 7:06 am
Access, I believe simply represents the FALSE boolean value (both in data storage and in VBA script) as -1. Both systems actually just look for the absense of zero, not the existence of 1 or -1. I suppose technically it could be -1, 1, or 5 for that matter since internally, it's looking to see whether the value is 0 or not 0...
HTH,
Jay
May 23, 2003 at 7:59 am
Thanks Jay,
I thought MS handles things similar across its products
ROTFL
Cheers,
Frank
--
Frank Kalis
Microsoft SQL Server MVP
Webmaster: http://www.insidesql.org/blogs
My blog: http://www.insidesql.org/blogs/frankkalis/[/url]
May 26, 2003 at 1:27 am
for BIT value :
True = 1 (in SQL Server)
True = -1 (in Access db)
false = 0 for the two system
( so when you link, Access Automatically [internally] convert 1 to -1, and when you save it the ODBC convert
-1 to 1 .. (or it just a display convert))
I hope this help u
Alamir Mohamed
Alamir Mohamed
Alamir_mohamed@yahoo.com
May 27, 2003 at 2:21 pm
thnks for the help
ilan
Viewing 9 posts - 1 through 8 (of 8 total)
You must be logged in to reply to this topic. Login to reply