There is no function for getting the current branch_id right?
In dynamic model code, the parameters @model_id and @branch_id are provided. In the full staged control procedure code I do not see how they are obtained.
I want to write a script, not dynamic code, and use the SF and IAM DB, so I need to filter by branch_id.
Is this a reliable way of getting the branch_id of the DB you are currently connected to:
SELECT TOP 1 SF_BRANCH FROM sf_model_info ORDER BY sf_model_info_id desc
unless you start changing the connections between branches and databases, i guess

