The UKIRT Infrared Deep Sky Survey (UKIDSS) is a set of five large near-infrared surveys, covering a complementary range of areas, depths, and Galactic latitudes. The UKIDSS Second Data Release (DR2) includes the First Data Release (DR1), with minor improvements, plus new data for the LAS, GPS, GCS, and DXS, from observations made over 2006 May through July (when the UDS was unobservable). DR2 was staged in two parts. The first part excluded the GPS, and took place on 2007 March 1. The GPS was released on 2007 April 12. DR2 includes 282 sq. degs of multicolour data to (Vega) K=18, complete in the full YJHK set for the LAS, 57 sq. degs in the ZYJHK set for the GCS, and 236 sq. degs in the JHK set for the GPS. DR2 includes nearly 7 sq. degs of deep JK data (DXS, UDS) to an average depth K=21. In addition the release includes a comparable quantity of data where coverage of the filter set for any survey is incomplete. We document changes that have occurred since DR1 to the pipeline, calibration, and archive procedures. The two most noteworthy changes are presentation of the data in a single database (compared to two previously), and provision of additional error flags for detected sources, flagging potentially spurious artifacts, corrupted data and suspected cross-talk sources. We summarise the contents of each of the surveys in terms of filters, areas, and depths.