• Post Reply Bookmark Topic Watch Topic
  • New Topic

insert boolean value in a column with data type bit

 
gaurav chaudhary
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In MSSQLServer2000, I am having a table named Table1. In this table, there is only one column with column name bit_test. Now, when I run this query

it is giving me the error that error converting varchar to bit field. Can you please tell me how can i insert this boolean in a column whose datatype is bit
thanks
gaurav
 
Tina Coleman
Ranch Hand
Posts: 150
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I seem to recall having to convert my booleans to 1s and 0s when we ran into the same problem in mySQL. Don't guarantee that that's the best solution, but it worked.
 
Gravity is a harsh mistress. But this tiny ad is pretty easy to deal with:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!