Quality indicators are used to measure whether healthcare professionals act according to guidelines, but few indicators focus on the quality of pharmacotherapy for diabetes. The aim of this study was to develop and validate a set of prescribing quality indicators (PQIs) for type 2 diabetes in primary care, and to apply this set in practice. To take into account the stepwise treatment of chronic disease, clinical action indicators were specifically considered. Potential PQIs were derived from clinical practice guidelines and evaluated using the RAND/UCLA Appropriateness Method, a modified Delphi panel. Thereafter, the feasibility of calculating the PQIs was tested in two large Dutch primary care databases including >80000 diabetes patients in 2012. 32 PQIs focusing on treatment with glucose, lipid, blood pressure and albuminuria lowering drugs, and on vaccination, medication safety and adherence were assessed by ten experts. After the Delphi panel, the final list of twenty PQIs was tested for feasibility. All PQIs definitions were feasible for measuring the quality of medication treatment using these databases. Indicator scores ranged from 18.8% to 90.8% for PQIs focusing on current medication use, clinical action and medication choice, and from 2.1% to 37.2% for PQIs focusing on medication safety. Twenty PQIs focusing on treatment with glucose, lipid, blood pressure and albuminuria lowering drugs, and on medication safety in type 2 diabetes were developed, considered valid and operationally feasible. Results showed room for improvement, especially in initiation and intensification of treatment as measured with clinical action indicators.