def exec_procedure(session, proc_name, params):
    sql_params = ','.join(['@{0}={1}'.format(name, value) for name, value in
        list(params.items())])
sql_string = (
    """
        DECLARE @return_value int;
        EXEC    @return_value = [dbo].[{proc_name}] {params};
        SELECT 'Return Value' = @return_value;
    """
    .format(proc_name=proc_name, params=sql_params))
return session.execute(sql_string).fetchall()
хранимые процедуры с sqlAlchemy