How do I create a bit constant in T-SQL? I tried using Convert(bit, 0) but that is having a weird effect in SSDT.
Asked
Active
Viewed 273 times
0
-
what weird effect are you referring to ? – Squirrel Sep 04 '14 at 05:37
-
Actually this is a BS question and should be deleted. The problem I was seeing had nothing to do with using Convert. – Jonathan Allen Sep 04 '14 at 06:44
2 Answers
1
Have you tried: CAST(0 AS BIT)
Also have a look here:
Imply bit with constant 1 or 0 in SQL Server
0
I'm not sure what you mean by a weird effect in SSDT, but here's two more options you can try:
Using CAST
instead of convert:
CAST(0 AS BIT)
Declaring the variables first:
DECLARE
@True BIT,
@False BIT;
SET @True = 1;
SET @False = 0;

Robby Cornelissen
- 91,784
- 22
- 134
- 156