Tuesday, April 29, 2014

T-SQL: COALESCE returns int for integer operations


DECLARE @can_import BIT

PRINT CAST (SQL_VARIANT_PROPERTY(COALESCE(@can_import, 0), 'BaseType') AS VARCHAR(20))

Result:
int

No comments: