T-SQL should have a bit literal format - by Greg Low - Australia

Status : 

 


22
0
Sign in
to vote
ID 611171 Comments
Status Active Workarounds
Type Suggestion Repros 0
Opened 10/6/2010 3:38:15 PM
Access Restriction Public
Primary Feedback Item 356470

Description

T-SQL has literal formats for most data types. There is no literal format for a bit.

For example, if I wish to return a bit column from a CASE statement such as:

SELECT CASE WHEN something THEN 1 ELSE 0 END AS Somecolumn

I have to wrap it in a CAST or CONVERT to avoid getting an integer type.
Sign in to post a comment.
Posted by Microsoft on 4/21/2011 at 6:28 PM
Hello Greg,
I have resolved your request as duplicate of below:

http://connect.microsoft.com/SQLServer/feedback/details/356470/support-syntax-for-typed-literal-values

Your specific request is covered there and what you are asking for is truth values (TRUE, FALSE) as specified by ANSI SQL. We will look at it for a future version.

--
Umachandar, SQL Programmability Team
Posted by Microsoft on 11/29/2010 at 9:09 AM
Hi Greg,

Thank you for the suggestion, it does make sense and we will put it on the list for a future release.

Thanks
- Tobias, SQL Server Engine
Posted by Microsoft on 11/29/2010 at 9:09 AM
Hi Greg,

Thank you for the suggestion, it does make sense and we will put it on the list for a future release.

Thanks
- Tobias, SQL Server Engine