spAddUpdate_NetGroupRelation
Parameters
| Parameter | Parameter Type | Mode | Description |
|---|---|---|---|
| @PKID | int | INOUT | |
| @NetGroupID | int | IN | |
| @NetAccountID | int | IN | |
| @Confirmation | int | IN | |
| @BlockedID | int | IN |
Definition
Copy
CREATE PROCEDURE [dbo].[spAddUpdate_NetGroupRelation]
(
@PKID int output,
@NetGroupID int,
@NetAccountID int,
@Confirmation int,
@BlockedID int
)
AS
BEGIN
IF (@PKID<=0)
BEGIN
INSERT INTO [NetGroupRelation]
(
NetGroupID,
NetAccountID,
Confirmation
)
VALUES
(
@NetGroupID,
@NetAccountID,
@Confirmation
)
SELECT @PKID = @@Identity
END
ELSE
UPDATE [NetGroupRelation] SET
NetGroupID = @NetGroupID,
NetAccountID = @NetAccountID,
Confirmation = @Confirmation ,
BlockedID = @BlockedID,
UpdateDate = getUTCDate()
WHERE [ID]=@PKID
if @Confirmation IN (1,2,3)
begin
UPDATE [NetGroupRelation] SET ConfirmationDate = getUTCDate() WHERE [ID]=@PKID AND ConfirmationDate IS NULL
end
END