Imagine I have the following SELECT statement in a view (SQL Server 2008):
SELECT (SELECT CASE
WHEN HISTORY.OUTOFSERV = 'Y' OR HISTORY.OUTOFSERV = 'y' THEN 1
ELSE 0
END) AS OOS
FROM HISTORY
The column OOS ends up being of type int, but I'd like it to be of type bit. How can I accomplish this?