Checks that actual value IS NOT NULL or empty string and report failure if actual value is NULL or an empty string.

 Arguments

  • V_ActualValue - actual value, NVARCHAR(4000).
  • v_UserMessage – message to report when assertion fails, NVARCHAR(MAX).

 

Examples

SQL Server

CREATE PROCEDURE UT_DBTD_CheckThatCustomerNameIsNotNullOrEmpty
AS
BEGIN
   DECLARE @v_CustomerName VARCHAR(500);
   DECLARE @v_UnknownCustomer INT = 123456789;
   SET @v_CustomerName = dbo.fnGetCustomerName(@v_UnknownCustomer);

   EXEC DBTD_ASSERT_IS_NOT_NULL_OR_EMPTY @v_CustomerName, 'Customer name should not be NULL or empty string'
END;
GO

 

See Also