In a sql table I have a bit field and the value is displayed as True, when I update in code Update table1 set Active='True' it makes the update but the value is now displayed as 1 instead of True. How do I make it put the value 'True' instead of the integer in the table? Thanks.
1 Answer
Bits in SQL Server are always stored as 1 or 0 in a bitmap.
The "Edit Table" option in SSMS just translates this to True or False for presentation purposes, this is nothing to do with how it is actually stored.
2 Comments
user282807
Was getting confused when doing a select query.
Martin Smith
@user - Yes. If you wanted it returned as a string you would need to do
CASE Col when 1 THEN 'True' WHEN 0 THEN 'False' END or apply such formatting in the presentation layer.
Trueand then1?