USP_CMSOBJECTSECURITYEXCEPTION_BULK_ADD
The save procedure used by the add dataform template "CMS Object Security Exception Bulk Add".
Parameters
Parameter | Parameter Type | Mode | Description |
---|---|---|---|
@ID | uniqueidentifier | INOUT | The output parameter indicating the ID of the record added. |
@CHANGEAGENTID | uniqueidentifier | IN | Input parameter indicating the ID of the change agent invoking the procedure. |
@SECUREDOBJECTGUID | uniqueidentifier | IN | Input parameter indicating the context ID for the record being added. |
@XMLDATA | xml | IN | XML Data |
Definition
Copy
CREATE procedure dbo.USP_CMSOBJECTSECURITYEXCEPTION_BULK_ADD
(
@ID uniqueidentifier = null output,
@CHANGEAGENTID uniqueidentifier = null,
@SECUREDOBJECTGUID uniqueidentifier,
@XMLDATA xml = null
)
as
set nocount on;
if @ID is null
set @ID = newid()
if @CHANGEAGENTID is null
exec dbo.USP_CHANGEAGENT_GETORCREATECHANGEAGENT @CHANGEAGENTID output
declare @CURRENTDATE datetime
set @CURRENTDATE = getdate()
begin try
begin transaction
delete from dbo.CMSOBJETSECURITYEXCEPTION where SECUREDOBJECTGUID = @SECUREDOBJECTGUID
if @XMLDATA.exist('/exceptionCollection/exception') = 1
begin
insert into dbo.CMSOBJETSECURITYEXCEPTION ([SECUREDOBJECTGUID],[EXCEPTIONOBJECTGUID],[OBJECTTASKID], ADDEDBYID, CHANGEDBYID, DATEADDED, DATECHANGED)
select
@SECUREDOBJECTGUID,
EXC.EX.value('@objectID', 'uniqueidentifier'),
EXC.EX.value('@taskID', 'uniqueidentifier'),
@CHANGEAGENTID, @CHANGEAGENTID, @CURRENTDATE, @CURRENTDATE
from @XMLDATA.nodes('/exceptionCollection/exception') EXC(EX)
end
commit
end try
begin catch
exec dbo.USP_RAISE_ERROR
return 1
end catch
return 0