spClone_Discussions

Parameters

Parameter Parameter Type Mode Description
@PKID int INOUT
@CloneContentID int IN
@ClonedContentID int IN
@CurrentUsersID int IN

Definition

Copy

            CREATE    Procedure [dbo].[spClone_Discussions]
            (
            @PKID int output,
            @CloneContentID int,
            @ClonedContentID int,
            @CurrentUsersID int
            )
            as

            DECLARE @NewGuid uniqueidentifier
            SET @NewGuid = NEWID()

        Insert into DiscussionGroups
            (GroupName,
              RequiresApproval,
             Guid,
             SiteContentID,
             PostNewTopicMessage,
             PostNewReplyMessage,
             SpellTopicWithErrors,
             SpellTopicNoErrors,
             SpellReplyWithErrors,
             SpellReplyNoErrors)

        Select   GroupName,
             RequiresApproval,
             @NewGuid,
             @CloneContentID,
             PostNewTopicMessage,
             PostNewReplyMessage,
             SpellTopicWithErrors,
             SpellTopicNoErrors,
             SpellReplyWithErrors,
             SpellReplyNoErrors
        from DiscussionGroups
        Where SiteContentiD = @ClonedContentID

        SELECT @PKID = @@Identity

        DECLARE @OldGuid uniqueidentifier
        SELECT @OldGuid=Guid FROM DiscussionGroups WHERE SiteContentiD = @ClonedContentID

        exec spClone_RoleObjectPrivs @OldGuid, @NewGuid

        exec spAuditThis @CurrentUsersID, 1, @NewGuid, 1