USP_DATAFORMTEMPLATE_VIEW_CMSAUTOLOG_TOKEN
The load procedure used by the view dataform template "CMS Autolog token"
Parameters
Parameter | Parameter Type | Mode | Description |
---|---|---|---|
@ID | nvarchar(1000) | IN | The input ID parameter used to load the fields defined on the form. |
@DATALOADED | bit | INOUT | Output parameter indicating whether or not data was actually loaded. |
@USERID | int | INOUT | UserID |
Definition
Copy
CREATE procedure dbo.USP_DATAFORMTEMPLATE_VIEW_CMSAUTOLOG_TOKEN
(
@ID nvarchar(1000),
@DATALOADED bit = 0 output,
@USERID int = null output
)
as
set nocount on;
SELECT @ID = CONVERT(nvarchar(MAX), CONVERT(XML,@ID).value('.', 'varbinary(max)'))
-- be sure to set this, in case the select returns no rows
set @DATALOADED = 1;
set @USERID = -1;
EXEC dbo.USP_GET_KEY_ACCESS
SET @ID = Convert(nvarchar(100), DECRYPTBYKEY(@ID))
CLOSE symmetric key sym_BBInfinity;
exec dbo.USP_AUTHENTICATE_CMS_AUTOLOG_TOKEN @ID, @USERID output
if @USERID is null or @USERID = 0
set @USERID = -1
return 0;