spBreakBackOfficeSystemUsersLink
Parameters
Parameter | Parameter Type | Mode | Description |
---|---|---|---|
@PKID | int | IN | |
@CurrentUsersID | int | IN | |
@BackOfficeSystemID | int | IN |
Definition
Copy
CREATE PROCEDURE [dbo].[spBreakBackOfficeSystemUsersLink]
(
@PKID int,
@CurrentUsersID int,
@BackOfficeSystemID int = 0
)
AS
BEGIN
set nocount on
begin transaction
UPDATE ClientUsers
SET IsProvisional = 1
WHERE ID = @PKID
delete from BackOfficeSystemUsers
where BackOfficeSystemUsers.clientusersid = @PKID
and exists
(select *
from backofficesystempeople p
where
p.id = BackOfficeSystemUsers.BackOfficePeopleID
and p.BackOfficeSystemID = @BackOfficeSystemID
)
commit
END