Update sql bit field in database

纵然是瞬间 提交于 2019-12-07 01:40:36

问题


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:


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.



来源:https://stackoverflow.com/questions/6879999/update-sql-bit-field-in-database

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!