Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

UDFS: how do I specify a Boolean return type

Status
Not open for further replies.

francisT

Programmer
Jul 2, 2001
5
Hi

I would like to write a User-Defined Function (UDF)
that returns a Boolean value. This would mean
that the UDF could be used where T-SQL syntax
calls for a Boolean expression.

Could someone tell me how I do this? The list
of scalar return types for UDFs does not include
a Boolean type, but I wonder if there is a
workaround, using some other scalar type (much
as in C and C++ Boolean expressions).

Regards

FrancisT
 
I would try using a tinyint. Return 1 for true and 0 for false.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top