14

I have installed a table editor, (Universal Table Editor) which is coded by classic asp. However I am not able to edit or delete a column. I recieve the error

Invalid column name 'False'

The reasons seems to be bit field of SQL Server, it displays true/false but it is not a boolean field.

So is there a way to solve it in SQL Server?, or is there an easy solution on ASP code? (I saw a solution for adding a parameter booleanasbit = true, but couldn't implement it)

HOY
  • 1,067
  • 10
  • 42
  • 85

1 Answers1

25

When setting a BIT field, use 0 for 'False' and 1 for 'True'.

Note that there are no quotes around the 0 or 1.

nealkernohan
  • 788
  • 1
  • 6
  • 15
  • Invalid value for cell. String was not recognized as a valid Boolean. An error like that is displayed. – HOY Mar 30 '12 at 11:14
  • I am tring to edit directly from sql management studio, and the above error is recieved with no quotes. – HOY Mar 30 '12 at 11:20
  • I'm not sure I understand your question now. Can you please paste the SQL you are trying to execute? – nealkernohan Mar 30 '12 at 11:26
  • 4
    Management Studio 2005/2008/2008 R2 has an annoying "feature" that requires you to enter `True` or `False` instead of `1` or `0` for `BIT` columns. They've kind of fixed it in 2012 - it now allows you to enter `0` or `1` but still allows you to enter boolean strings as well. http://connect.microsoft.com/SQLServer/feedback/details/264592/ssms-edit-top-n-rows-expects-true-false-in-bit-columns I strongly recommend you stay away from this Edit Top N Rows spreadsheet simulator anyway, and write proper DML queries in a query window. – Aaron Bertrand Mar 30 '12 at 11:29
  • Actually I don't see the sql, I am using a generic table editor to view my tables, and click delete button on a row. After this error is displayed, here is the same error that I am facing with http://forums.databasejournal.com/showthread.php?t=26582 – HOY Mar 30 '12 at 11:30
  • Unfortunately, I think this is an error inherent to the Universal Table Editor. – nealkernohan Mar 30 '12 at 11:58