Is it possible to create a SQL Server function which returns a nullable string?
I would like to create a function which returns DBNull if the value is 0 or an empty string:
Create FUNCTION [dbo].[SetDBNullNvarChar] (@input nvarchar(1000))
RETURNS (needs to be nullable)
AS
BEGIN
if (@input = '' OR @input = 0)
BEGIN
RETURN null
END
return @input
END