SHARE
TWEET

cust_CCIW_get_save_future_address

DataCCIW Dec 9th, 2019 (edited) 92 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. CREATE PROCEDURE [dbo].[cust_CCIW_get_save_future_address]
  2. @OrganizationID INT,
  3. @Guid UNIQUEIDENTIFIER,
  4. @ActiveDate DATETIME
  5.  
  6. AS
  7. BEGIN
  8.     DECLARE @FutureAddressLUID INT = 11554
  9.  
  10.     IF @ActiveDate != ''
  11.     BEGIN
  12.         UPDATE core_person_address
  13.         SET active_date = @ActiveDate
  14.         FROM core_person P
  15.         JOIN core_family_member M1 on M1.person_id = P.person_id
  16.         JOIN core_family_member M2 ON M1.family_id = M2.family_id
  17.         JOIN core_person_address A2 ON A2.person_id = M2.person_id
  18.         WHERE P.guid = @Guid
  19.         AND A2.address_type_luid = @FutureAddressLUID
  20.     END
  21.  
  22.     SELECT CPA.* FROM core_person P
  23.        JOIN core_person_address CPA ON P.person_id = CPA.person_id
  24.          WHERE P.guid = @Guid
  25.          AND CPA.address_type_luid = @FutureAddressLUID
  26.  
  27. END
  28. GO
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top