IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[F_YN]') AND type in (N'FN', N'IF', N'TF', N'FS', N'FT')) DROP FUNCTION [dbo].[F_YN] GO SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO create function [dbo].[F_YN](@CS tinyint) returns varchar(4) as begin declare @S varchar(4) if @CS is null set @S=' ·ٌ' else if @CS=0 set @S=' ·ٌ' else set @S='تا' return @S end GO select dbo.f_yn('')