SQL View Name:dt_contact_view
SQL View Number:4757
Group:Dovetail Support
Base Table:contact
Description:Contacts and their primary site, including data restrictions
Flags:VIEW_OPTIMIZED 
Baseline/Custom:Custom

Fields:

Field NameCommon TypeDatabase TypeGeneric Field IDArray SizeDefaultFlagsComment
contact_objidLONGint   USER_DEFINED  
e_mailCHARvarchar   USER_DEFINED  
first_nameCHARvarchar   USER_DEFINED  
last_nameCHARvarchar   USER_DEFINED  
phoneCHARvarchar   USER_DEFINED  
primary_siteLONGint   USER_DEFINED  
siteCHARvarchar   USER_DEFINED  
site_idCHARvarchar   USER_DEFINED  
site_objidLONGint   USER_DEFINED  
statusLONGint   USER_DEFINED  
update_stampCLK_TIMEdatetime   USER_DEFINED  
x_res1CHARvarchar   USER_DEFINED  
x_res2CHARvarchar   USER_DEFINED  
x_res3CHARvarchar   USER_DEFINED  
x_res4CHARvarchar   USER_DEFINED  
x_res5CHARvarchar   USER_DEFINED  

SQL:


SELECT c.objid as contact_objid, s.objid as site_objid, c.first_name, c.last_name, c.phone, c.update_stamp,
s.name as site, s.site_id, r.primary_site, c.status as status, c.e_mail,
s.x_res1, s.x_res2, s.x_res3, s.x_res4, s.x_res5
FROM table_contact c
INNER JOIN table_contact_role r ON c.objid = r.contact_role2contact
INNER JOIN table_site s ON s.objid = r.contact_role2site
WHERE c.status = 0 AND r.primary_site = 1
My Recent Objects
dt_contact_view