The invention belongs to the technical field of
software development, and discloses a method and a device of generating an
SQL statement automatically. The method comprises the steps of determining adata model corresponding to a target data table in a
database according to a preset
programming interface instruction input by a user, wherein the
data model comprises specific annotations, the specific annotations are used for determining a correspondence between the
data model and the target data table and representing necessary parameters generating standard format of
SQL statements; and then invoking a preset
programming interface to produce specific labels in the
data model into standard format of
SQL statements by using a preset generation rule, wherein each part of the standard format of SQL statement is corresponding to the specific
annotation. In the method, specific
annotation can be produced into standard format of SQL statement automatically according to preset generation rulesby invoking the preset
programming interface only, and developers do not need to program standard format of SQL statements manually, so that the programming amount is reduced, and the working efficiency is improved.