
663 S.W.2d 131 (1983)
Joe C. HEFLIN, Appellant,
v.
Robert D. STILES, Appellee.
No. 2-83-041-CV.
Court of Appeals of Texas, Fort Worth.
December 22, 1983.
*132 Taylor & Mizell, P.C. and Randall S. Frye and William V. Counts, Jr., Dallas, for appellant.
Christopher J. Harris, Arlington, and J. Michael Brounoff, Irving, for appellee.
Before JORDAN, BURDOCK and HILL, JJ.

OPINION
BURDOCK, Justice.
This case involves a lease agreement which was assigned without the lessor's consent. Summary judgment was granted for appellee. We reverse and remand.
By written "Agreement of Lease" dated September 5, 1973, one Hyden and Stiles (appellee) d/b/a Hyden-Stiles, G.M.C., Inc. leased certain real property located in Arlington from one John King for a ten-year term. Among the provisions of the lease is the following:
4th. That the Lessee shall not assign this agreement or underlet the premises or any part thereof (except as may be mentioned herein) ... without the consent of the Lessor in writing: ... [Emphasis added.]
The lease contains no exceptions to the requirements of written consent of the lessor to any assignment or sub-lease.
By written instrument entitled "This Agreement of Lease," dated November 1, 1973, Hyden-Stiles, G.M.C., Inc., sub-leased the property in question to Heflin (appellant) for a three-year term. On November 15, 1976, a new instrument was executed renewing the previous sub-lease to Heflin and extending the term of the sub-lease to October 31, 1983.
Subsequently, on October 30, 1977, Heflin purchased the property in question, thereby becoming not only the owner of the title (and lessor to Hyden and Stiles under the base lease of September 5, 1973), but sublessee under Hyden and Stiles. From that time through August 1978, Heflin continued to pay rent as a sub-tenant in the amount of $575.00 per month to Hyden and Stiles who, in turn, paid rent to Heflin as owner and lessor in the amount of $335.00 per month.
On August 9, 1978, pursuant to a winding up of the partnership, Hyden assigned (by written agreement) to Stiles all of his [Hyden's] interest in the September 5, 1973 lease, without obtaining Heflin's consent, written or otherwise.
Upon learning of the assignment, Heflin stopped making rental payments under the sub-lease and refused to accept payments from Stiles. Heflin returned to Stiles uncashed rent checks for the months of September, October, and November, all of 1978, *133 together with a notice cancelling the lease. On October 12, 1978, Heflin sent Stiles a "Notice to Vacate" stating as the reason that "Lessee assigned lease without written consent of Lessor."
Stiles filed suit against Heflin in September, 1981 to recover past rent under the sub-lease. Heflin answered and also filed a counterclaim for termination of the base lease and the underlying sub-lease on the grounds that Stiles and Hyden breached the base lease by entering into the August 9, 1978 assignment agreement without the owner's [Heflin's] consent.
Both parties filed Motions for Summary Judgment. The trial court awarded summary judgment to Stiles, including attorney's fees and interest. A take nothing judgment was entered as to Heflin's counterclaim.
On appeal, appellant [Heflin] raises six points of error (numbered 1, 1-A, 2, 2-A, 3, and 3-A). Points 1 and 3-A read as follows:
1. The District Court erred in denying Heflin's Motion for Summary Judgment, and in rendering summary judgment for Stiles (both as to Stiles' claim and Heflin's counterclaim), because the summary judgment proof conclusively established, beyond factual dispute, as a matter of law, that Stiles' partner, Hyden, as co-lessee of real property from Heflin, assigned his interest in the lease dated September 5, 1973 to Stiles without the consent of Heflin, the owner, in violation of the lease and of TEX.REV.CIV.STAT. art. 5237; wherefore Heflin, as owner, was entitled to terminate the lease and the underlying sub-lease to himself, and to hold Stiles responsible for the rent under the base lease.
3A. Alternatively, the trial court erred in rendering summary judgment for Stiles against Heflin, as to Stiles' claim and Heflin's counterclaim, because the summary judgment proof created a fact issue as to whether or not Heflin waived or was estopped from asserting his right to assert the contractual and statutory violation by Hyden and Stiles in failing to obtain Heflin's consent as property owner to the August 9, 1978 assignment of the lease of September 5, 1973.
Because we base our decision on these points, we will not consider appellant's remaining points, save for one.
In his supplemental brief, appellant contends that appellee has abandoned his cause of action. In his original petition, appellee characterized the November 15, 1973 agreement between Hyden-Stiles, G.M.C., Inc. and appellant as a "sub-lease" and sought past rent thereunder. Subsequently, in his First Amended Original Petition and Motion for Summary Judgment, appellee characterized this same agreement as an "assignment" and sought to recover consideration thereto. However, we do not agree with appellant that appellee has abandoned his cause of action. In Lakeside Park v. Dr. Pepper Bottling Co., 44 S.W.2d 1023, 1025 (Tex.Civ.App.-Fort Worth 1931, no writ), the court stated:
It is insisted that the allegations of the petition are variant from and in conflict with the terms of the contract, and therefore state no cause of action. The petition refers to the contract as attached thereto as an exhibit. In such case we think the fact that the pleader in his petition alleges the legal effect of the contract at variance with and not justified by proper legal effect of the contract itself does not render the petition subject to demurrer. In such case the court will construe the contract and if its proper legal effect, when applied to the facts alleged, confers a right of recovery, the general demurrer should be overruled.
Here, a copy of the November 15 agreement was attached to the pleadings and made a part thereof. Therefore, the court was free to look at the agreement and determine if it conferred a right of recovery. See also Frost v. Wells, 388 S.W.2d 235, 237-38 (Tex.Civ.App.-Amarillo 1965, writ dism'd) ("Since Wells attached a copy of the contract to his petition and made it a part thereof, we think the contract takes precedence over the allegations of the petition and we must look to the contract as *134 determining the matters here.") Accordingly, appellant's supplemental point of error no. 1 is overruled.
Appellant next contends that Hyden assigned his interest to appellee on August 9, 1978 without appellant's consent, thus violating the lease and art. 5237. TEX. REV.CIV.STAT.ANN. art. 5237 (Vernon 1962) provides:
A person renting said lands or tenements shall not rent or lease the same during the term of said lease to any other person without first obtaining the consent of the landlord, his agent or attorney.
This statutory rule forbids an assignment as well as a subletting. Dillingham v. Williams, 165 S.W.2d 524, 526 (Tex.Civ.App.- El Paso 1942, writ ref'd w.o.m.). Furthermore, it is made a part of all lease contracts by operation of law unless the parties therein clearly express a contrary intent. American Nat. Bank v. First Wis. Mtg. Trust, 577 S.W.2d 312, 316 (Tex.Civ.App.-Beaumont 1979, writ ref'd n.r.e.); Young v. De La Garza, 368 S.W.2d 667, 669 (Tex.Civ.App.- Dallas 1963, no writ).
The record reveals that the parties to the base lease (dated September 5, 1973) clearly did not express a contrary intent. In fact, the base lease goes beyond the statute in requiring that the landlord's consent to any sub-lease or assignment be made in writing (see clause 4 set out above).
It is undisputed that Hyden and appellee failed to obtain the consent of Heflin, written or otherwise, before entering into their "assignment" agreement. However, appellee argues that this agreement was merely a dissolution of a partnership between the co-lessees whereby one of the lessees succeeds to the other's interest under the lease. As such, it should not be a transaction which constitutes an assignment in breach of the base lease. Both appellant and appellee cite numerous cases from other jurisdictions for their respective propositions. Neither party cites a Texas case directly on point, and after diligent search, we, too, have been unable to find one. Neither art. 5237 nor clause 4 of the base lease provides an exception for a subletting or assignment between co-lessees or business partners.
In his brief, appellee does direct our attention to Denning v. Republic National Bank Bldg. Co., 294 S.W.2d 888 (Tex.Civ. App.-Dallas 1956, writ ref'd n.r.e.). There the court stated:
It has been held that permitting a third person to enter into the joint occupation of the premises with the lessee is not necessarily a subletting, and that the fact that a lessee conducting a business on the demised premises takes a third person into partnership with him and thus lets such third person into joint possession of the premises is not a breach of a covenant against subletting.

Denning, supra at 898. Appellee urges that Denning should be extended to the situation at hand. We disagree. Denning is factually distinguishable. Whereas it involved the addition of a third person, we are faced with the removal of one of the partners.
Article 5237, and any similar provision in a lease, is solely for the benefit of the landlord. Fair West Building Corp. v. Trice Floor Coverings, 394 S.W.2d 707, 708 (Tex.Civ.App.-Fort Worth 1965, no writ). It was doubtless enacted to secure to the owners of the lands the selection of persons to occupy and care for them, as well as to secure them the right to have none occupy their lands whose ability or willingness to pay the rents contracted for was not satisfactory. Forrest v. Durnell, 86 Tex. 647, 26 S.W. 481, 482 (1894). See also GuadalupeBlanco River Au. v. City of San Antonio, 145 Tex. 611, 200 S.W.2d 989, 998 (1947) ("The purpose in requiring the consent of the City to the assignment was to retain in the City the right to determine with whom it would have to deal in securing performance of the contract.")
An analogy may be drawn between the case before us and a contract situation in general. In Moore v. Mohon, 514 S.W.2d 508, 513 (Tex.Civ.App.-Waco 1974, no writ), the Court stated:
Rights arising out of contract cannot be transferred if they involve a relation of *135 personal confidence, such that the party whose agreement conferred those rights must have intended them to be exercised only by him in whom he actually confided. [Citation omitted.] Whenever the contracting parties have relied on the skill, character or credit of each other, the law will not permit one of such parties to substitute for himself another person in which the opposite party may not repose an equal trust or confidence. [Citation omitted.] Everyone has a right to select and determine with whom he will contract and another cannot be thrust upon him without his consent. [Citation omitted.]
See also Arkansas Valley Smelting Co. v. Belden Mining Co., 127 U.S. 379, 8 S.Ct. 1308, 1309, 32 L.Ed. 246 (1888) ("You have the right to the benefit you anticipate from the character, credit, and substance of the party with whom you contract.")
We hold that the August 9, 1978 agreement between Hyden and appellee, without appellant's consent, was an assignment which constituted a violation of both the lease itself and art. 5237. As a result, appellant would have us reverse and render judgment in his favor, but we believe the better decision is to remand this case to the trial court. There are fact issues raised by the appellee in his response to appellant's motion for summary judgment as to whether appellant (by retaining three rental payments) waived his right to terminate the lease agreement.
Accordingly, we sustain appellant's point of error no. 3-A and reverse and remand this cause for trial.
