2009-08-19

Get contact status in custom extended marketing list


declare @contactid uniqueidentifier
declare @campaignactivityid uniqueidentifier
-- some Guids
set @contactid='48CF39EE-AA8C-DE11-A526-000C2989FA53'
set @campaignactivityid='72CE8156-AD8C-DE11-A526-000C2989FA53'

select exL.New_ExtMarketingListsElementId, exL.New_contactStatus
from dbo.New_ExtMarketingListsElementExtensionBase exL
JOIN dbo.ContactBase cnt ON exL.new_contact=cnt.ContactId
JOIN dbo.ListBase lst ON exL.new_list=lst.ListId
JOIN dbo.CampaignActivityItemBase cai ON lst.ListId=cai.ItemId
where cnt.ContactId=@contactid
and cai.CampaignActivityId=@campaignactivityid

Комментариев нет: