Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL Boolean

Status
Not open for further replies.

adridude

Programmer
Aug 16, 2006
3
GB
Aloha people.

At the moment, I am having a problem with SQL 2005. I have just imported a massive >1GB MSAccess database (of all things) to SQL, and it went smoothely. Only one thing, it converted Yes/No (bool fields) to bits; Which is totally correct.

The underlying application, all 120000 lines of code of it, uses queries like:
select * from icecream where melted=False
...
Problem is:
SQL wants it like this:
...
select * from icecream where melted='False'
... or ...
select * from icecream where melted=0

Anybody know how I can get about that, without having to traul through all this code?

Cheers

Adridude
 
As a temporary remedy, you might try linking the SQL database through Access and connecting to Access instead. The Access would simply become just a gateway to the SQL database, without storing any data.
 
Add a new column to the tables of the type varchar(5). Update the table with True or False depending on the bit value. Remove the bit value and rename the new column to the old name.


Or

Rename the table, create a view in SQL that converts the bit field to True/False. Have access talk to the view instead.

Denny
MCSA (2003) / MCDBA (SQL 2000) / MCTS (SQL 2005) / MCITP Database Administrator (SQL 2005)

--Anything is possible. All it takes is a little research. (Me)
[noevil]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top