IF EXISTS(select * FROM sys.views where name = 'v_LoyaltyDetail')
BEGIN
	DROP VIEW v_LoyaltyDetail
END
