I am not sure how to insert boolean values from an Access query into a SQL Server table.
Access generally uses 0 for false, -1 for true. In SQL Server it's 1 for true.
So my question is this: if I want to insert a true value into my SQL Server table, can I just say -1 anyway, and SQL Server will know how to interpret it? Or do I have to put the 1 for true ?
EDIT: additionally, is it possible to just put true instead of a numeric value into the insert statement?
Quick sample to illustrate:
CREATE TABLE BoolTest(SomeText VARCHAR(50), SomeBool BIT)
INSERT INTO dbo.BoolTest (SomeText, SomeBool)
VALUES ('Text 1', 0), (`Text 2', 1), ('Text 3', -1)
SELECT *
FROM dbo.BoolTest
I get this result:

So SQL Server interprets anything other than 0 as a True value.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With