General information
Forum:
Microsoft SQL Server
Category:
Stored procedures, Triggers, UDFs
Hi,
i have code and is return zero, what do i miss to my code?
alter FUNCTION RET_xxx (@val varchar(20))
returns varchar
AS
begin
declare @ret varchar(20)
IF LEN(@val) = 1
set @ret= '0000'+@val
ELSE IF LEN(@val) = 2
set @ret= '000'+@val
ELSE IF LEN(@val) = 3
set @ret= '00'+@val
ELSE IF LEN(@val) >= 4
set @ret= '0'+@val
RETURN(@ret)
end
TIA
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only