dbo.ufnGetDocumentStatusText
Documentation | AdventureWorks |
Schema | dbo |
Name | ufnGetDocumentStatusText |
Module | Products |
Scalar function returning the text representation of the Status column in the Document table.
Input/Output
Mode | Name | Data type | Description | |
---|---|---|---|---|
1 | OUT | Returns | nvarchar(16) | Returns the text representation of the Status column |
Returns the text representation of the Status column | ||||
2 | IN | Status | tinyint | Input parameter for the scalar function ufnGetDocumentStatusText. Enter a valid integer. |
Input parameter for the scalar function ufnGetDocumentStatusText. Enter a valid integer. |
Script
CREATE FUNCTION [ufnGetDocumentStatusText](@Status [tinyint]) RETURNS [nvarchar](16) AS -- Returns the sales order status text representation for the status value. 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; |
Exported: 2019-02-04 23:13, Last imported: 2018-03-07 11:56