Reasons why batch generates more than one query plan? I know that a single batch can have more than one query plan but want to learn some more about the cases when more than one execution plans are generated. Is it because of a batch length or the use of some statements? Is there maximum limit for query plans for a single batch?

Thanks
Each query in the batch needs a plan. And furthermore, each procedural function (scalar function or multi statement table valued function) in the batch needs a plan too, which is often less obvious.