spAddUpdate_ProfileEditorFields
Parameters
Parameter | Parameter Type | Mode | Description |
---|---|---|---|
@PKID | int | INOUT | |
@FieldID | int | IN | |
@Caption | nvarchar(50) | IN | |
@Editable | bit | IN | |
@Required | bit | IN | |
@allowDelete | bit | IN | |
@AllowPrivate | bit | IN | |
@UseCodeTable | bit | IN | |
@AllowNewCodes | bit | IN | |
@Include | bit | IN | |
@ContentId | int | IN | |
@FieldAttribId | int | IN | |
@ShowInGrid | bit | IN |
Definition
Copy
CREATE PROCEDURE dbo.spAddUpdate_ProfileEditorFields
(
@PKID int output,
@FieldID int,
@Caption nvarchar(50),
@Editable bit,
@Required bit,
@allowDelete bit,
@AllowPrivate bit,
@UseCodeTable bit,
@AllowNewCodes bit,
@Include bit,
@ContentId int,
@FieldAttribId int,
@ShowInGrid bit
)
AS
begin transaction
if (@PKID<=0)
begin
INSERT INTO ProfileEditorFields
(
FieldID,
Caption,
Editable,
Required,
allowDelete,
AllowPrivate,
UseCodeTable,
AllowNewCodes,
[Include],
ContentId,
FieldAttribID,
ShowInGrid
)
VALUES
(
@FieldID,
@Caption,
@Editable,
@Required,
@allowDelete,
@AllowPrivate,
@UseCodeTable,
@AllowNewCodes,
@Include,
@ContentId,
@FieldAttribID,
@ShowInGrid
)
SELECT
@PKID = @@Identity
end else begin
UPDATE ProfileEditorFields SET
FieldID=@FieldID,
[Caption]= @Caption,
Editable= @Editable,
Required= @Required,
allowDelete=@allowDelete,
AllowPrivate= @AllowPrivate,
UseCodeTable= @UseCodeTable,
AllowNewCodes= @AllowNewCodes,
[Include] = @Include,
ContentId=@ContentId,
FieldAttribID=@FieldAttribID,
ShowInGrid=@ShowInGrid
WHERE ID=@PKID
end
commit transaction