title: LINQ - "SQL statement is nested too deeply" issue in MVC application
body: <p>I am stuck for a while now, and was hoping someone can point me in the right directions. </p>
  
  <p>below part of code throws me an error :
  <em>"Some part of your SQL statement is nested too deeply. Rewrite the query or break it up into smaller queries"</em></p>
  
  <p>Can seomeone please advise me, how to write it in "smaller queries" ?</p>
  
  <pre><code>var cnpPendingForCogRole = (from p in db.udf_tbl_GetPendingCnpForRoleAboveStep4((int)CnpAbove4StepRolesEnum.CogManager, 0)
                                                  join g in CogList on p.CogName equals g
                                                  select p.cnpId).ToList();
  </code></pre>