<PAGE>

                                                                    EXHIBIT 10.4

                             AMENDMENT NUMBER TWO
             TO AMENDED AND RESTATED SECURITIES PURCHASE AGREEMENT
             -----------------------------------------------------


     THIS AMENDMENT NUMBER TWO TO AMENDED AND RESTATED SECURITIES PURCHASE
AGREEMENT (this "Amendment") dated as of December 22, 1999, is entered into
between SYSTEM SOFTWARE ASSOCIATES, INC., a Delaware corporation ("Issuer"), and
H&Q SSA INVESTORS, L.P. ("Investor"), in light of the following:


                                   RECITALS
                                   --------

     A.   Issuer and Investor are parties to that certain Amended and Restated
Securities Purchase Agreement dated as of September 8, 1997, as amended by
Amendment Number One to Amended and Restated Securities Purchase Agreement dated
as of August 11, 1999 (as amended, the "SPA").

     B.   Issuer and Investor desire to amend the SPA under the terms and
conditions set forth in this Amendment.

     NOW, THEREFORE, in consideration of the foregoing and the mutual covenants
herein contained, and for other good and valuable consideration, the receipt and
sufficiency of which are hereby acknowledged, the parties hereby agree as
follows:

     1.   Amendments to the SPA.  The parties agree that the following defined
          ---------------------
terms contained in Section 1.1 of the SPA hereby are amended and restated in
their entirety as follows:

     "Foothill Credit Agreement" means that certain Loan and Security Agreement
dated as of August 11, 1999, as amended by the First Amendment to Loan and
Security Agreement dated as of December 22, 1999, among the Company, certain
subsidiaries of the Company, the financial institutions identified therein as
"Lenders" and Foothill Capital Corporation, as agent for the Lenders.

     "Credit Agreement" means one or more agreements for one or more credit
facilities to be entered into by the Company in an aggregate amount not in
excess of $51,000,000 (including any refinancings, refundings, renewals, or
extensions of such facilities); the Foothill Credit Agreement shall be deemed a
Credit Agreement for purposes of this Agreement.

     2.   Consent.  Investor hereby consents to the transactions contemplated by
          -------
the First Amendment to Loan and Security Agreement dated as of December __,
1999, and agrees that, notwithstanding anything to the contrary in the SPA,
Issuer may enter into, and perform its obligations under said First Amendment,
and the same shall not be deemed to be a default or event of default under the
SPA.

1
<PAGE>

     IN WITNESS WHEREOF, the parties have entered into this Amendment as of the
date first above written.


                                   SYSTEM SOFTWARE ASSOCIATES, INC.



                                   By: /s/ Joseph J. Skadra
                                      ------------------------------------------

                                   Name:   Joseph J. Skadra
                                        ----------------------------------------

                                   Title: Vice President, Finance and Controller
                                         ---------------------------------------



                                   H&Q SSA INVESTORS, L.P.



                                   By: /s/ Andrew W. Kahn
                                      ------------------------------------------

                                   Name:   Andrew W. Kahn
                                         ---------------------------------------

                                   Title: Managing Director
                                         ---------------------------------------

2