Function:
[AdventureWorks2016CTP3].[dbo].[ufnGetDocumentStatusText_native]
Function properties
| Name | Value |
| Schema | [dbo] |
| Owner | [dbo] |
| Creation date | 23.10.2015 |
| Type | Scalar |
| Is schema bound | ![]() |
| Is deterministic | |
| Encrypted | |
| Implementation type | Transact SQL |
| ID | 1700201107 |
Creation options
| Name | Value |
| QUOTED_IDENTIFIER | ON |
| ANSI_NULLS | ON |
Parameters
| Name | Description | DataType | Max length | ReadOnly |
| @Status | tinyint | 1 |
Recordset returned
| Name | Datatype | Max length |
| @Return | nvarchar | 15 |
SQL
SET ANSI_NULLS ON SET QUOTED_IDENTIFIER ON GO CREATE FUNCTION dbo.ufnGetDocumentStatusText_native (@Status tinyint) RETURNS nvarchar(15) WITH NATIVE_COMPILATION, SCHEMABINDING AS BEGIN ATOMIC WITH (TRANSACTION ISOLATION LEVEL = SNAPSHOT, LANGUAGE = N'English') IF @Status=1 RETURN 'Pending approval' IF @Status=2 RETURN 'Approved' IF @Status=3 RETURN 'Obsolete' RETURN '** Invalid **' END GO |
See also