Code moved to Service and Database SP updated to check for Static value and a column