AdventureWorks
dbo.ufnGetDocumentStatusText User Defined Function
Description
Scalar function returning the text representation of the Status column in the Document table.
Properties
Creation Date08/01/2010 08:41
Encrypted
Ansi Nulls
Parameters
ParameterDirectionDescriptionData TypeSize
@StatusInInput parameter for the scalar function ufnGetDocumentStatusText. Enter a valid integer.tinyint1
@RETURN_VALUEReturn Value nvarchar16
Procedure Source Code
CREATE FUNCTION [dbo].[ufnGetDocumentStatusText](@Status [tinyint])
RETURNS [nvarchar](16) 
AS 

BEGIN
DECLARE @ret [nvarchar](16);
SET @ret = 
CASE @Status
WHEN 1 THEN N'Pending approval'
WHEN 2 THEN N'Approved'
WHEN 3 THEN N'Obsolete'
ELSE N'** Invalid **'
END;

RETURN @ret
END;
See Also

Related Objects

dbo Schema
AdventureWorks Database

 

 


© 2012 All Rights Reserved.

Send comments on this topic.