The present invention relates to an effective fraction of alkaloids and the effective fraction is prepared from mulberry twig and its active ingredients are a composition of alkaloids. Determined by HPLC, the percentage of the total alkaloids are 50% or more by weight in the effective fraction and the percentage of the compound 1-deoxynojirimycin is 30% or more by weight in the total alkaloids. The effective fraction of the invention is prepared as the following steps: the mulberry twig is extracted by solvents, and the extract is precipitated by alcohol precipitation or flocculation to remove the impurities, and then concentrated, purified by resin chromatography. The present invention also relates to a pharmaceutical composition containing the said effective fraction of alkaloids and to the use of the effective fraction of alkaloids according to claim 1-4 in preparing hypoglycemic agents.