USP_DATAFORMTEMPLATE_ADD_SYSTEMROLECOPY

The save procedure used by the add dataform template "System Role Copy Add Form".

Parameters

Parameter Parameter Type Mode Description
@ID uniqueidentifier INOUT The output parameter indicating the ID of the record added.
@SYSTEMROLEID uniqueidentifier IN Input parameter indicating the context ID for the record being added.
@ROLENAME nvarchar(255) IN Role name
@DESCRIPTION nvarchar(max) IN Description
@CHANGEAGENTID uniqueidentifier IN Input parameter indicating the ID of the change agent invoking the procedure.
@COPYUSERS bit IN Copy assigned users

Definition

Copy


CREATE procedure dbo.USP_DATAFORMTEMPLATE_ADD_SYSTEMROLECOPY
(
    @ID uniqueidentifier output,
    @SYSTEMROLEID uniqueidentifier,
    @ROLENAME nvarchar(255),
    @DESCRIPTION nvarchar(max) = '',
    @CHANGEAGENTID uniqueidentifier = null,
    @COPYUSERS bit = 0
)
as
    set nocount on;

    if @ID is null
        set @ID = newid();

    if @CHANGEAGENTID is null
        exec dbo.USP_CHANGEAGENT_GETORCREATECHANGEAGENT @CHANGEAGENTID output;

    declare @return int;
    exec @return = dbo.USP_SYSTEMROLE_COPY
                            @ID = @ID,
                            @CHANGEAGENTID = @CHANGEAGENTID,
                            @ROLENAME = @ROLENAME,
                            @DESCRIPTION = @DESCRIPTION,
                            @SYSTEMROLEID = @SYSTEMROLEID,
                            @COPYUSERS = @COPYUSERS;

    return @return;