Get sg_id for setting the SG-IDs; use right method for fetching sg_ids