spAddUpdate_DiscussionGroups
Parameters
| Parameter | Parameter Type | Mode | Description |
|---|---|---|---|
| @PKID | int | INOUT | |
| @GroupName | nvarchar(510) | IN | |
| @Guid | uniqueidentifier | IN | |
| @SiteContentID | int | IN | |
| @PostNewTopicMsg | nvarchar(510) | IN | |
| @PostNewReplyMsg | nvarchar(510) | IN | |
| @SpellTopicWithErrors | nvarchar(510) | IN | |
| @SpellTopicNoErrors | nvarchar(510) | IN | |
| @SpellReplyWithErrors | nvarchar(510) | IN | |
| @SpellReplyNoErrors | nvarchar(510) | IN | |
| @RequiresApproval | bit | IN | |
| @AllowAnonymous | bit | IN | |
| @AnonymousName | nvarchar(30) | IN |
Definition
Copy
CREATE PROCEDURE [dbo].[spAddUpdate_DiscussionGroups]
(
@PKID int output ,
@GroupName nvarchar(510) ,
@Guid uniqueidentifier,
@SiteContentID int ,
@PostNewTopicMsg nvarchar(510) ,
@PostNewReplyMsg nvarchar(510) ,
@SpellTopicWithErrors nvarchar(510) ,
@SpellTopicNoErrors nvarchar(510) ,
@SpellReplyWithErrors nvarchar(510) ,
@SpellReplyNoErrors nvarchar(510) ,
@RequiresApproval bit ,
@AllowAnonymous bit ,
@AnonymousName nvarchar(30)
)
AS
Begin
begin transaction
if (@PKID<=0)
begin
INSERT INTO DiscussionGroups
(
GroupName ,
Guid ,
SiteContentID ,
PostNewTopicMessage ,
PostNewReplyMessage ,
SpellTopicWithErrors ,
SpellTopicNoErrors ,
SpellReplyWithErrors ,
SpellReplyNoErrors ,
RequiresApproval ,
AllowAnonymous ,
AnonymousName
)
VALUES
(
@GroupName ,
@Guid ,
@SiteContentID ,
@PostNewTopicMsg ,
@PostNewReplyMsg ,
@SpellTopicWithErrors ,
@SpellTopicNoErrors ,
@SpellReplyWithErrors ,
@SpellReplyNoErrors ,
@RequiresApproval ,
@AllowAnonymous ,
@AnonymousName
)
SELECT @PKID = @@Identity
end
else
begin
UPDATE DiscussionGroups SET
GroupName =@GroupName ,
Guid =@Guid ,
SiteContentID =@SiteContentID ,
PostNewTopicMessage =@PostNewTopicMsg ,
PostNewReplyMessage =@PostNewReplyMsg ,
SpellTopicWithErrors =@SpellTopicWithErrors ,
SpellTopicNoErrors =@SpellTopicNoErrors ,
SpellReplyWithErrors =@SpellReplyWithErrors ,
SpellReplyNoErrors =@SpellReplyNoErrors ,
RequiresApproval =@RequiresApproval ,
AllowAnonymous =@AllowAnonymous ,
AnonymousName =@AnonymousName
WHERE ID=@PKID
end
commit transaction
End