Can anyone explain why when viewing a table that has a bit datatype field, through Query Designer in SSMS, you cannot edit the values to be '1' or '0'
You get the error message:
String was not recognised as a valid Boolean
Type a value appropriate for the data type
Funny that, I'm not trying to store a boolean, I'm trying to store a bit, i.e. "An integer data type that can take a value of 1, 0, or NULL." [BOL]
Ok - so MS have decided to expose this in the Query Designer as a boolean - that I can handle - but then not allowing '1','0' or 'T','F' seems crazy!
Note : I don't actually recommend the use of Query Designer for modifying data!
Answer by Matt Whitfield ·
It's because the native .NET Boolean type is extremely fussy in what it interprets as True / False. That was something I paid particular attention to in my editor.
But that fussiness is a pain elsewhere too - for example, if you're editing an XML file that XmlSerializer will be reading, then even if you get the capitalisation wrong, then it won't recognise it as a Boolean.
Welcome to the world of tomorrow!