USP_DATAFORMTEMPLATE_EDIT_SITE_2
The save procedure used by the edit dataform template "Site Edit Form".
Parameters
Parameter | Parameter Type | Mode | Description |
---|---|---|---|
@ID | uniqueidentifier | IN | The input ID parameter indicating the ID of the record being edited. |
@CHANGEAGENTID | uniqueidentifier | IN | Input parameter indicating the ID of the change agent invoking the procedure. |
@NAME | nvarchar(250) | IN | Name |
@SHORTNAME | nvarchar(100) | IN | Short name |
@SITEID | nvarchar(100) | IN | Site ID |
@ACRONYM | nvarchar(100) | IN | Acronym |
@SITETYPECODEID | uniqueidentifier | IN | Site type |
@DESCRIPTION | nvarchar(max) | IN | Description |
Definition
Copy
CREATE procedure dbo.USP_DATAFORMTEMPLATE_EDIT_SITE_2
(
@ID uniqueidentifier,
@CHANGEAGENTID uniqueidentifier = null,
@NAME nvarchar(250),
@SHORTNAME nvarchar(100),
@SITEID nvarchar(100),
@ACRONYM nvarchar(100),
@SITETYPECODEID uniqueidentifier,
@DESCRIPTION nvarchar(max)
)
as
set nocount on;
declare @CURRENTDATE datetime;
set @CURRENTDATE = getdate();
if @CHANGEAGENTID is null
exec dbo.USP_CHANGEAGENT_GETORCREATECHANGEAGENT @CHANGEAGENTID output;
update
dbo.SITE
set
NAME = @NAME,
SHORTNAME = @SHORTNAME,
SITEID = @SITEID,
ACRONYM = @ACRONYM,
SITETYPECODEID = @SITETYPECODEID,
DESCRIPTION = @DESCRIPTION,
CHANGEDBYID = @CHANGEAGENTID,
DATECHANGED = @CURRENTDATE
where
ID = @ID;
return 0;