ObjectivesType 2 diabetes is an important public health problem but the risk in UK military veterans is unknown. We used data from the Trends in Scottish Veterans' Health study to investigate the risk in comparison with people with no record of service.DesignRetrospective cohort study of a large national sample in Scotland, with up to 37 years follow-up.SettingPseudoanonymised extract of computerised Scottish National Health Service records, including a disease register and national vital records.Participants78 000 veterans and 253 000 people with no record of service matched for age, sex and area of residence.Outcome measuresCox proportional HRs for first record of type 2 diabetes in veterans compared with non-veterans, overall and by sex and birth cohort. Long-term trend, comorbidity with specific mental health outcomes and risk of limb loss.ResultsOverall, 7.2% of veterans were diagnosed with type 2 diabetes, and were at slightly increased risk compared with non-veterans, Cox proportional HR 1.08, 95%CIs 1.04 to 1.11, p<0.001. The increased risk was confined to men, and to veterans born prior to 1960. There has been no change in HR over the last 25 years. Among veterans with post-traumatic stress disorder (PTSD), 12.1% had been diagnosed with type 2 diabetes, compared with 9.4% of non-veterans with PTSD. The difference was statistically significant, OR 1.29, 95% CI 1.04 to 1.59, p=0.021. Risk of limb loss was increased among the oldest veterans.ConclusionsOlder veterans in Scotland have an increased risk of type 2 diabetes in comparison with non-veterans, but there is no difference in respect of younger veterans, and the pattern of risk shows no evidence that it is changing. There is a positive association between type 2 diabetes and PTSD, especially in the presence of comorbid mood disorder, an important finding which should be noted by care providers.