标签:end state roc %s null res BMI declare char
create PROCEDURE [dbo].[spTASKS_ASSIGNED_Update] ( @ID UNIQUEIDENTIFIER OUTPUT , @MODIFIED_USER_ID UNIQUEIDENTIFIER = NULL , @ASSIGNED_USER_ID UNIQUEIDENTIFIER = NULL ) AS DECLARE @ASSIGNED_USER_NAME NVARCHAR(100); SELECT @ASSIGNED_USER_NAME = ASSIGNED_TO_NAME FROM dbo.vwTASKS WHERE ID = @ID; IF @ASSIGNED_USER_NAME IS NULL BEGIN UPDATE [TASKS] SET [MODIFIED_USER_ID] = @MODIFIED_USER_ID , [DATE_MODIFIED] = GETDATE() , [ASSIGNED_USER_ID] = @ASSIGNED_USER_ID , STATUS = ‘In progress‘ WHERE [ID] = @ID; END; ELSE BEGIN RAISERROR (N‘Submit failed, this task is assigned to %s!‘, 16, -- Severity. 1, -- State. @ASSIGNED_USER_NAME ); END;
标签:end state roc %s null res BMI declare char
原文地址:https://www.cnblogs.com/kangjing/p/8872562.html