View: dbo.Bank_View
View definition
`CREATE VIEW dbo.Bank_View AS SELECT Bank.bank_KEY , Bank.bank_name , Bank.routing_number , Bank.fractional_routing_number , Bank.comments , Bank.contact_KEY , Bank.record_status_KEY , Bank.is_international_bank , Bank.restrict_bank_client_access -- NOT Bank.existing_bad_data , CT.primary__contact_phone_type_KEY AS contact__primary__contact_phone_type_KEY , CT.primary__contact_address_type_KEY AS contact__primary__contact_address_type_KEY , CT.mailing__contact_address_type_KEY AS contact__mailing__contact_address_type_KEY , CT.contact_type_KEY AS contact__contact_type_KEY , CT.primary__contact_email_type_KEY AS contact__primary__contact_email_type_KEY , Record_Status.description AS record_status__description -- Column added to match with the Active_Status View for Status Filter. -- Null value suggests that the row is virtually deleted. , CASE WHEN Bank.record_status_KEY = 1 THEN 1 WHEN Bank.record_status_KEY = 2 THEN 2 ELSE NULL END AS active_status_KEY FROM dbo.Bank AS Bank LEFT OUTER JOIN dbo.Contact AS CT ON CT.contact_KEY = Bank.contact_KEY LEFT OUTER JOIN dbo.Record_Status AS Record_Status ON Record_Status.record_status_KEY = Bank.record_status_KEY ;`