Reputation: 746
Why the query below is not working? Doesn't a logical expression return a boolean/bitwise value?
SELECT @v1 = CAST( (@v2 > 0) AS INT)
Upvotes: 5
Views: 1389
Reputation: 17943
Following statement will do what you are trying to achieve.
SELECT @V1 = IIF ( @V2 > 0, 1, 0 )
Upvotes: 6