Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CREATE PROCEDURE [dbo].[cust_CCIW_get_save_future_address]
- @OrganizationID INT,
- @Guid UNIQUEIDENTIFIER,
- @ActiveDate DATETIME
- AS
- BEGIN
- DECLARE @FutureAddressLUID INT = 11554
- IF @ActiveDate != ''
- BEGIN
- UPDATE core_person_address
- SET active_date = @ActiveDate
- FROM core_person P
- JOIN core_family_member M1 on M1.person_id = P.person_id
- JOIN core_family_member M2 ON M1.family_id = M2.family_id
- JOIN core_person_address A2 ON A2.person_id = M2.person_id
- WHERE P.guid = @Guid
- AND A2.address_type_luid = @FutureAddressLUID
- END
- SELECT CPA.* FROM core_person P
- JOIN core_person_address CPA ON P.person_id = CPA.person_id
- WHERE P.guid = @Guid
- AND CPA.address_type_luid = @FutureAddressLUID
- END
- GO
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement