Return Bit Value as 1/0 and NOT True/False in SQL Server

前端 未结 5 1936
無奈伤痛
無奈伤痛 2020-12-09 02:29

I have a Table in SQL Server 2000 with BitValue Column. But, it is being displayed as True/False in SQL Server Management Studio. When I do a Select * from Tablename

5条回答
  •  爱一瞬间的悲伤
    2020-12-09 03:06

    Try with this script, maybe will be useful:

    SELECT CAST('TRUE' as bit) -- RETURN 1
    SELECT CAST('FALSE' as bit) --RETURN 0
    

    Anyway I always would use a value of 1 or 0 (not TRUE or FALSE). Following your example, the update script would be:

    Update Table Set BitField=CAST('TRUE' as bit) Where ID=1
    

提交回复
热议问题