<PAGE>
 
                                                                    EXHIBIT 10.4
                                                                    ------------
                         DENDRITE INTERNATIONAL, INC.

                           1997 STOCK INCENTIVE PLAN


          1.  Purpose.  The purpose of the Dendrite International, Inc. 1997 
              -------
Stock Incentive Plan (the "Plan") is to enhance the ability of Dendrite
International, Inc. (the "Company") and its subsidiaries to attract and retain
employees and directors of outstanding ability and to provide employees and
directors with an interest in the Company parallel to that of the Company's
shareholders.

          2.  Definitions.
              ----------- 

              (a) "Award" shall mean an award determined in accordance with the
terms of the Plan.

              (b) "Board" shall mean the Board of Directors of the Company.

              (c) "Change in Control" shall mean the occurrence of any one of
the following events:

                  (i)  any "person" (as such term is defined in Section 3(a)(9)
          of the Exchange Act and as used in Sections 13(d)(3) and 14(d)(2) of
          the Exchange Act) is or becomes a "beneficial owner" (as defined in
          Rule 13d-3 under the Exchange Act), directly or indirectly, of
          securities of the Company representing 33-1/3% or more of the combined
          voting power of the Company's then outstanding securities eligible to
          vote for the election of the Board (the "Company Voting Securities");
          provided, however, that the event described in this paragraph (i)
          --------  -------                                                
          shall not be deemed to be a Change in Control by virtue of any of the
          following acquisitions:  (A) by the Company or any subsidiary, (B) by
          any employee benefit plan sponsored or maintained by the Company or
          any subsidiary, (C) by any underwriter temporarily holding securities
          pursuant to an offering of such securities, (D) pursuant to a Non-
          Control Transaction (as defined in paragraph (iii)), or (E) a
          transaction (other than one described in (iii) below) in which Company
          Voting Securities are acquired from the Company, if a majority of the
          Incumbent Board (as defined below) approves a resolution providing
          expressly that the acquisition pursuant to this clause (E) does not
          constitute a Change in Control under this paragraph (i);

                  (ii) individuals who, on the Effective Date, constitute the
          Board (the "Incumbent Board") cease for any reason to constitute at
<PAGE>
 
          least a majority thereof, provided that any person becoming a director
          subsequent to the Effective Date, whose election or nomination for
          election was approved by a vote of at least two-thirds of the
          directors comprising the Incumbent Board (either by a specific vote or
          by approval of the proxy statement of the Company in which such person
          is named as a nominee for director, without objection to such
          nomination) shall be considered a member of the Incumbent Board;
          provided, however, that no individual initially elected or nominated
          --------  -------                                                   
          as a director of the Company as a result of an actual or threatened
          election contest with respect to directors or any other actual or
          threatened solicitation of proxies or consents by or on behalf of any
          person other than the Board shall be deemed to be a member of the
          Incumbent Board;

                  (iii)  the shareholders of the Company approve a merger,
          consolidation, share exchange or similar form of corporate
          reorganization of the Company or any such type of transaction
          involving the Company or any of its subsidiaries (whether for such
          transaction or the issuance of securities in the transaction or
          otherwise) (a "Business Combination"), unless immediately following
          such Business Combination:  (A) more than 50% of the total voting
          power of the publicly traded corporation resulting from such Business
          Combination (including, without limitation, any corporation which
          directly or indirectly has beneficial ownership of 100% of the Company
          Voting Securities or all or substantially all of the assets of the
          Company and its subsidiaries) eligible to elect directors of such
          corporation would be represented by shares that were Company Voting
          Securities immediately prior to such Business Combination (either by
          remaining outstanding or being converted), and such voting power would
          be in substantially the same proportion as the voting power of such
          Company Voting Securities immediately prior to the Business
          Combination, (B) no person (other than any publicly traded holding
          company resulting from such Business Combination, any employee benefit
          plan sponsored or maintained by the Company (or the corporation
          resulting from such Business Combination), or any person which
          beneficially owned, immediately prior to such Business Combination,
          directly or indirectly, 33-1/3% or more of the Company Voting
          Securities (a "Company 33-1/3% Stockholder")) would become the
          beneficial owner, directly or indirectly, of 33-1/3% or more of the
          total voting power of the outstanding voting securities eligible to
          elect directors of the corporation resulting from such Business
          Combination and no Company 33-1/3% Stockholder would increase its
          percentage of such total voting power, and (C) at least a majority of
          the members of the board of directors of the corporation resulting
          from such Business Combination would be members of the Incumbent Board
          at the time of the Board's approval of the 

                                      -2-
<PAGE>
 
          execution of the initial agreement providing for such Business
          Combination (a "Non-Control Transaction"); or

                  (iv) the shareholders of the Company approve a plan of
          complete liquidation or dissolution of the Company or the sale or
          disposition of all or substantially all of the Company's assets.

          Notwithstanding the foregoing, a Change in Control of the Company
shall not be deemed to occur solely because any person acquires beneficial
ownership of more than 33-1/3% of the Company Voting Securities as a result of
the acquisition of Company Voting Securities by the Company which, by reducing
the number of Company Voting Securities outstanding, increases the percentage of
shares beneficially owned by such person; provided, that if a Change in Control
                                          --------  ----                       
of the Company would occur as a result of such an acquisition by the Company (if
not for the operation of this sentence), and after the Company's acquisition
such person becomes the beneficial owner of additional Company Voting Securities
that increases the percentage of outstanding Company Voting Securities
beneficially owned by such person, then a Change in Control of the Company shall
occur.

              (d) "Code" shall mean the Internal Revenue Code of 1986, as
amended.

              (e) "Committee" shall mean a committee of at least two members of
the Board appointed by the Board to administer the Plan and to perform the
functions set forth herein and who are "non-employee directors" within the
meaning of Rule 16b-3 as promulgated under Section 16 of the Exchange Act and
who are also "outside directors" within the meaning of Section 162(m) of the
Code.

              (f) "Common Stock" shall mean the common stock, no par value per
share, of the Company.

              (g) "Exchange Act" shall mean the Securities Exchange Act of
1934, as amended.

              (h) "Fair Market Value" per share as of a particular date shall
mean the last reported sale price (on the day immediately preceding such date)
of the Common Stock on the NASDAQ National Market List.

              (i) "Immediate Family Member" shall mean, except as otherwise
determined by the Committee, a Participant's children, stepchildren,
grandchildren, parents, stepparents, grandparents, spouse, siblings, in-laws and
persons related by reason of legal adoption.

                                      -3-
<PAGE>
 
              (j) "Incentive Stock Option" shall mean a stock option which is
intended to meet the requirements of Section 422 of the Code.

              (k) "Non-Employee Director" shall mean a member of the Board who
is not an employee of the Company or any Subsidiary.

              (l) "Nonqualified Stock Option" shall mean a stock option which
is not intended to be an Incentive Stock Option.

              (m) "Option" shall mean either an Incentive Stock Option or a
Nonqualified Stock Option.

              (n) "Participant" shall mean an employee or director of the
Company or its Subsidiaries who is selected to participate in the Plan in
accordance with Section 5.

              (o) "Subsidiary" shall mean any subsidiary of the Company that is
a corporation and which at the time qualifies as a "subsidiary corporation"
within the meaning of Section 424(f) of the Code.

          3.  Shares Subject to the Plan.  Subject to adjustment in accordance
              --------------------------                                      
with Section 16, the total of the number of shares of Common Stock which shall
be available for the grant of Awards under the Plan shall not exceed 500,000
shares; provided, that, for purposes of this limitation, any Option which is
        --------  ----                                                      
canceled or expires without exercise shall again become available for Awards
under the Plan.  Upon forfeiture of Awards in accordance with the provisions of
the Plan, and the terms and conditions of the Award, such shares shall no longer
be counted in any determination of the number of shares available under the Plan
and shall be available for subsequent Awards.  Subject to adjustment in
accordance with Section 16, no employee shall be granted in any calendar year
Options to purchase more than 500,000 shares of Common Stock.  Shares of Common
Stock available for issue or distribution under the Plan shall be authorized and
unissued shares or shares reacquired by the Company in any manner.


          4.  Administration.   (a) The Plan shall be administered by the
              --------------                                             
Committee.

                    (b) The Committee shall (i) approve the selection of
Participants, (ii) determine the type of Awards to be made to Participants,
(iii) determine the number of shares of Common Stock subject to Awards, (iv)
determine the terms and conditions of any Award granted hereunder (including,
but not limited to, any restriction and forfeiture conditions on such Award) and
(v) have the authority to interpret the Plan, to establish, amend, and rescind
any rules and regulations relating to the Plan, to determine the terms and
provisions of any agreements entered into hereunder, and to make all other
determinations necessary or advisable for the administration of the Plan. The
Committee may correct any defect, supply any omission or reconcile any

                                      -4-
<PAGE>
 
inconsistency in the Plan or in any Award in the manner and to the extent it
shall deem desirable to carry it into effect.

              (c) Any action of the Committee shall be final, conclusive and
binding on all persons, including the Company and its Subsidiaries and
shareholders, Participants and persons claiming rights from or through a
Participant.

              (d) The Committee may delegate to officers or employees of the
Company or any Subsidiary, and to service providers, the authority, subject to
such terms as the Committee shall determine, to perform administrative functions
with respect to the Plan and Award agreements.

              (e) Members of the Committee and any officer or employee of the
Company or any Subsidiary acting at the direction of, or on behalf of, the
Committee shall not be personally liable for any action or determination taken
or made in good faith with respect to the Plan, and shall, to the extent
permitted by law, be fully indemnified by the Company with respect to any such
action or determination.

          5.  Eligibility.  Individuals eligible to receive Awards under the
              -----------                                                   
Plan shall be the officers and other key employees of the Company and its
Subsidiaries selected by the Committee.  In addition, all Non-Employee Directors
shall be eligible to receive Options as provided in Section 9 hereof.

          6.  Awards.  Awards under the Plan may consist of Options, stock
              ------                                                      
awards or other awards based on the value of the Common Stock.  Awards shall be
subject to the terms and conditions of the Plan and shall be evidenced by an
agreement containing such additional terms and conditions, not inconsistent with
the provisions of the Plan, as the Committee shall deem desirable.

          7.  Options.  Options may be granted under the Plan in such form as
              -------                                                        
the Committee may from time to time approve pursuant to terms set forth in an
Option agreement.  The Committee may alter or waive, at any time, any term or
condition of an Option that is not mandatory under the Plan.

              (a) Types of Options. Each Option agreement shall state whether or
                  ----------------
not the Option will be treated as an Incentive Stock Option or Nonqualified
Stock Option.

              (b) Option Price.  The purchase price per share of the Common
                  ------------
Stock purchasable under an Option shall be determined by the Committee, but in
the case of Incentive Stock Options, the Option price will be not less than 100%
of the Fair Market Value of the Common Stock on the date of the grant of the
Option and in the case of Incentive Stock Options granted to an employee owning
stock possessing more than 

                                      -5-
<PAGE>
 
10% of the total combined voting power of all classes of stock of the Company
and its Subsidiaries (a "10% Shareholder") the price per share specified in the
agreement relating to such Option shall not be less than 110% of the Fair Market
Value per share of the Common Stock on the date of grant.

              (c) Option Period.  The term of each Option shall be fixed by the
                  -------------                                                
Committee, but no Option shall be exercisable after the expiration of 10 years
from the date the Option is granted, provided, however, that in the case of
                                     --------  -------                     
Incentive Stock Options granted to 10% Shareholders, the term of such Option
shall not exceed 5 years from the date of grant.

              (d) Exercisability. Each Option shall vest and become exercis able
                  --------------
at a rate determined by the Committee at or subsequent to grant; provided,
                                                                 ----------
however, that no Option granted under this Section 7 shall become exercisable
-------
earlier than the time that the Plan is approved by the shareholders of the
Company in accordance with Section 21; provided, further, that upon the
                                       --------- --------
occurrence of a Change in Control before such shareholder approval, all
Incentive Stock Options granted hereunder shall automatically become
Nonqualified Stock Options and all Options shall vest and become immediately
exercisable in accordance with Section 10.

              (e) Method of Exercise.  Options may be exercised, in whole or in
                  ------------------                                           
part, by giving written notice of exercise to the Company specifying the number
of shares of Common Stock to be purchased.  Such notice shall be accompanied by
the payment in full of the Option purchase price.  Such payment shall be made:
(a) in cash, or (b) to the extent authorized by the Committee, by surrender of
shares of Common Stock owned by the holder of the Option, or (c) through
simultaneous sale through a broker of shares acquired on exercise, as permitted
under Regulation T of the Federal Reserve Board, or (d) through additional
methods prescribed by the Committee, or (e) by a combination of any such
methods.

          8.  Stock Awards.  Subject to such performance and employment
              ------------                                             
conditions as the Committee may determine, awards of Common Stock or awards
based on the value of the Common Stock may be granted either alone or in
addition to Options granted under the Plan.  Any Awards under this Section 8 and
any Common Stock covered by any such Award may be forfeited to the extent so
provided in the Award agreement, as determined by the Committee.

          9.  Non-Employee Director Stock Options.
              ----------------------------------- 

              (a) Initial Grant.  Nonqualified Stock Options to purchase 30,000
                  -------------                                                
shares of Common Stock shall be granted automatically to each Non-Employee
Director who is a Non-Employee Director on the day the Board approves the
adoption of the Plan.  With respect to each person who becomes a Non-Employee
Director after such 

                                      -6-
<PAGE>
 
date, Nonqualified Stock Options to purchase 30,000 shares of Common Stock shall
be granted automatically to each such Non-Employee Director on the day he or she
first becomes a Non-Employee Director.

              (b) Subsequent Options. In addition to the Nonqualified Stock
                  ------------------
Options granted to Non-Employee Directors under Section 9(a), Nonqualified Stock
Options to purchase 10,000 shares of Common Stock shall be granted automatically
to each Non-Employee Director, effective on the third anniversary date on which
such director was granted an Initial Option under Section 9(a) and on each
anniversary date thereafter; provided, however, he or she continues to serve as
                             --------  -------
a Non-Employee Director on such date.

              (c) Option Price. The purchase price for each Option granted under
                  ------------
this Section 9 to a Non-Employee Director shall be the Fair Market Value of the
Common Stock on the date of grant of the Option.

              (d) Exercisability. Each Initial Option granted under Section 9(a)
                  --------------
shall become exercisable and vest on the first anniversary of the date of grant
of such Option; provided, however, that no Option shall become exercisable
                --------  -------
earlier than the time that the Plan is approved by the shareholders of the
Company in accordance with Section 21; provided, further, that upon the
                                       --------- -------
occurrence of a Change in Control before such shareholder approval, all Options
shall vest and become immediately exercisable in accordance with Section 10.
Subsequent Options granted under Section 9(b) shall become exercisable and vest
1 year from the date of the grant thereof.

              (e) Method of Exercise. Each Option granted under this Section 9
                  ------------------
may be exercised in the same manner as provided in Section 7(e).

              (f) Option Period.  Each Option granted under this Section 9 shall
                  -------------                                                 
terminate 10 years from the date of grant unless sooner terminated by reason of
termination of service as a director of the Company and its Subsidiaries.

              (g) Termination of Director Status.
                  ------------------------------ 

                  (i) In the event of termination of service as a director of
          the Company and its Subsidiaries for any reason other than death or
          permanent disability (as determined by the Committee), an Option
          granted under this Section 9 (to the extent exercisable as of the date
          of termination) shall be exercisable for 90 days following such
          termination (but in no event beyond the term of the Option), and shall
          thereafter terminate.

                                      -7-
<PAGE>
 
                  (ii) In the event of the death of a Non-Employee Director
          while a director of the Company or any Subsidiaries, the Option (to
          the extent exercisable as of the date of death), shall be exercisable
          by any prior transferee or by the Non-Employee Director's designated
          beneficiary, or if none, the person(s) to whom such Non-Employee
          Director's rights under the Option are transferred by will or the laws
          of descent and distribution for 1 year following the date of death
          (but in no event beyond the term of the Option), and shall thereafter
          terminate.

                  (iii)  In the event of the termination of service as a
          director of the Company and its Subsidiaries due to permanent
          disability (as determined by the Committee), the Option (to the extent
          exercisable as of the date of termination), shall be exercisable for 3
          years following such termination of service (but in no event beyond
          the term of the Option), and shall thereafter terminate.

              (h) Except as expressly provided in this Section 9, any Option
granted to a Non-Employee Director hereunder shall be subject to the terms and
conditions of the Plan.

              10. Change in Control. Upon the occurrence of a Change in
                  -----------------
Control, all Options shall automatically become vested and exercisable in full
and all restrictions or conditions, if any, on any stock awards granted
hereunder shall automatically lapse. The Committee may, in its discretion,
include such further provisions and limitations in any agreement documenting
such Options as it may deem equitable and in the best interests of the Company.

              11. Forfeiture.  Notwithstanding anything in the Plan to the
                  ----------                                              
contrary, the Committee may provide in any Award agreement that in the event of
a serious breach of conduct by an employee or former employee (including,
without limitation, any conduct prejudicial to or in conflict with the Company
or its Subsidiaries), or any activity of any employee or former employee in
competition with any of the businesses of the Company or any Subsidiary, (a)
cancel any outstanding Award granted to such employee or former employee, in
whole or in part, whether or not vested, and/or (b) if such conduct or activity
occurs within 1 year following the exercise or payment of an Award, require such
employee or former employee to repay to the Company any gain realized or payment
received upon the exercise or payment of such Award (with such gain or payment
valued as of the date of exercise or payment).  Such cancellation or repayment
obligation shall be effective as of the date specified by the Committee.  Any
repayment obligation may be satisfied in Common Stock or cash or a combination
thereof (based upon the Fair Market Value of Common Stock on the day prior to
the date of payment), and the Committee may provide for an offset to any future
payments owed by the Company or any Subsidiary to the employee or former
employee if necessary to satisfy 

                                      -8-
<PAGE>
 
the repayment obligation. The determination of whether an employee or former
employee has engaged in a serious breach of conduct or any activity in
competition with any of the businesses of the Company or any Subsidiary shall be
determined by the Committee in good faith and in its sole discretion. This
Section 11 shall have no application following a Change in Control.

              12. Withholding. The Company shall have the right to deduct from
                  -----------
any payment to be made pursuant to the Plan the amount of any taxes required by
law to be withheld therefrom, or to require a Participant to pay to the Company
in cash such amount required to be withheld prior to the issuance or delivery of
any shares of Common Stock or the payment of cash under the Plan. Such taxes may
be paid by (a) delivering previously owned shares of Common Stock or (b) having
the Company retain shares of Common Stock which would otherwise be delivered
upon exercise or payment of Awards or (c) any combination of a cash payment or
the methods set forth in (a) and (b) above. For purposes of (a) and (b) above,
shares of Common Stock shall be valued at Fair Market Value determined as of the
day immediately prior to exercise or payment. If and to the extent authorized by
the Committee, the Company may, upon election by a Participant, withhold from
any distribution of Common Stock hereunder shares of Common Stock with a Fair
Market Value in excess of the Participant's required withholding obligation.

              13. Nontransferability, Beneficiaries. Unless otherwise determined
                  ---------------------------------
by the Committee with respect to the transferability of Nonqualified Stock
Options by a Participant to his Immediate Family Members (or to trusts or
partnerships or limited liability companies established for such family
members), no Award shall be assignable or transferable by the Participant,
otherwise than by will or the laws of descent and distribution or pursuant to a
beneficiary designation, and Options shall be exercisable, during the
Participant's lifetime, only by the Participant (or by the Participant's legal
representatives in the event of the Participant's incapacity). Each Participant
may designate a beneficiary to exercise any Option held by the Participant at
the time of the Participant's death or to be assigned any other Award
outstanding at the time of the Participant's death. If no beneficiary has been
named by a deceased Participant, any Award held by the Participant at the time
of death shall be transferred as provided in his will or by the laws of descent
and distribution. Except in the case of the holder's incapacity, an Option may
only be exercised by the holder thereof.

              14.  No Right to Employment. Nothing contained in the Plan or in
                   ----------------------
any Award under the Plan shall confer upon any employee any right with respect
to the continuation of employment with the Company or any of its Subsidiaries,
or interfere in any way with the right of the Company to terminate his or her
employment at any time. Nothing contained in the Plan shall confer upon any
employee or other person any claim or right to any Award under the Plan.

                                      -9-
<PAGE>
 
              15.  Governmental Compliance.  Each Award under the Plan shall be
                   -----------------------                                     
subject to the requirement that if at any time the Committee shall determine
that the listing, registration or qualification of any shares issuable or
deliverable thereunder upon any securities exchange or under any Federal or
state law, or the consent or approval of any governmental regulatory body, is
necessary or desirable as a condition thereof, or in connection therewith, no
such grant or award may be exercised or shares issued or delivered unless such
listing, registration, qualification, consent or approval shall have been
effected or obtained free of any conditions not acceptable to the Committee.

              16.  Adjustments.  In the event of any change in the outstanding
                   -----------                                                
shares of Common Stock by reason of any stock dividend or split,
recapitalization, merger, consolidation, spinoff, combination or exchange of
shares or other corporate change, or any distribution to holders of Common Stock
other than regular cash dividends, the number or kind of shares available for
Options and Awards under the Plan may be adjusted by the Committee as it shall
in its sole discretion deem equitable and the number and kind of shares subject
to any outstanding Awards granted under the Plan and the purchase price thereof
may be adjusted by the Committee as it shall in its sole discretion deem
equitable to preserve the value of such Awards.

              17. Award Agreement. Each Award under the Plan shall be evidenced
                  ---------------
by an agreement setting forth the terms and conditions, as determined by the
Committee, which shall apply to such Award, in addition to the terms and
conditions specified in the Plan.

              18. Amendment.  The Board may amend, suspend or terminate the Plan
                  ---------
or any portion thereof at any time, provided that (a) no amendment shall be made
without shareholder approval if such approval is necessary to comply with any
applicable law, regulation or stock exchange rule and (b) except as provided in
Section 16, no amendment shall be made that would adversely affect the rights of
a Participant under an Award theretofore granted, without such Participant's
written consent.

              19. General Provisions.
                  ------------------ 

                  (a) The Committee may require each Participant purchasing or
acquiring shares pursuant to an Award under the Plan to represent to and agree
with the Company in writing that such Participant is acquiring the shares for
investment and without a view to distribution thereof.

                  (b) All certificates for shares of Common Stock delivered
under the Plan pursuant to any Award shall be subject to such stock-transfer
orders and other restrictions as the Committee may deem advisable under the
rules, regulations, and other requirements of the Securities and Exchange
Commission, any stock exchange upon which the Common Stock is then listed, and
any applicable Federal or state securities 

                                     -10-
<PAGE>
 
law, and the Committee may cause a legend or legends to be put on any such
certificates to make appropriate reference to such restrictions. If the
Committee determines that the issuance of shares of Common Stock hereunder is
not in compliance with, or subject to an exemption from, any applicable Federal
or state securities laws, such shares shall not be issued until such time as the
Committee determines that the issuance is permissible.

              (c) It is the intent of the Company that the Plan satisfy, and be
interpreted in a manner that satisfies, the applicable requirements of Rule 16b-
3 as promulgated under Section 16 of the Exchange Act so that Participants will
be entitled to the benefit of Rule 16b-3, or any other rule promulgated under
Section 16 of the Exchange Act, and will not be subject to short-swing liability
under Section 16.  Accordingly, if the operation of any provision of the Plan
would conflict with the intent expressed in this Section 19(c), such provision
to the extent possible shall be interpreted and/or deemed amended so as to avoid
such conflict.

              (d) Except as otherwise provided by the Committee in the
applicable grant or Award agreement, a Participant shall have no rights as a
shareholder with respect to any shares of Common Stock subject to Options until
a certificate or certificates evidencing shares of Common Stock shall have been
issued to the Participant and, subject to Section 16, no adjustment shall be
made for dividends or distributions or other rights in respect of any share for
which the record date is prior to the date on which Participant shall become the
holder of record thereof.

              (e) The law of the State of New Jersey shall apply to all Awards
and interpretations under the Plan regardless of the effect of such state's
conflict of laws principles.

              (f) Where the context requires, words in any gender shall include
any other gender.

          20. Term of Plan.  Subject to earlier termination pursuant to Section
              ------------                                                     
18, the Plan shall have a term of 10 years from its Effective Date.

          21. Effective Date; Approval of Shareholders.  The Plan is effective
              ----------------------------------------                        
as of July 24, 1997.  The Plan is conditioned upon the approval of the
shareholders of the Company, and failure to receive their approval shall render
the Plan and all outstanding Awards issued thereunder void and of no effect;
provided, however, that this limitation shall have no effect upon the occurrence
--------  -------                                                               
of a Change in Control before such shareholder approval, and all Awards shall be
exercisable in accordance with their terms.

                                     -11-