Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.
Select distinct wrap.L0, wrap.L1, wrap.L2, wrap.L3, wrap.L4, wrap.ZIPCODE from ( SELECT dbo.PeopleMailingNameCalc(LTC.People2ID) as L0, dbo.AddressCollapseReturnL1L2L3L4(1, null, LTC.PeopleAddress2ID) as L1, dbo.AddressCollapseReturnL1L2L3L4(2, null, LTC.PeopleAddress2ID) as L2, dbo.AddressCollapseReturnL1L2L3L4(3, null, LTC.PeopleAddress2ID) as L3, dbo.AddressCollapseReturnL1L2L3L4(4, null, LTC.PeopleAddress2ID) as L4, (Select (isnull(Zip,'') + ' ' + isnull(Zip4,'')) FROM dbo.PeopleAddresses2 where PeopleAddress2ID=LTC.PeopleAddress2ID) as ZIPCODE FROM Membership2 INNER JOIN Body2 ON Membership2.BodyId = Body2.BodyId INNER JOIN MembershipStatus2 ON Membership2.MembershipStatusId = MembershipStatus2.MembershipStatusId INNER JOIN People2 ON Membership2.People2Id = People2.People2ID INNER JOIN @LocTableC LTC ON LTC.People2ID = People2.People2ID WHERE (People2.DateOfDeath IS NULL) AND (Membership2.People2ID in (select People2ID from @LocTableC)) ) as wrap ORDER BY CASE WHEN @OrderBy = 'ZIP' THEN wrap.ZIPCODE ELSE wrap.L0 END
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
Join the community of 500,000 technology professionals and ask your questions.