This is the usual formula for describing the reign of a king in Israel. It occurs more than thirty times in the Old Testament. Here the reference is to David’s total reign, including the seven years in Judah and the subsequent years over all Israel. This is made clear in the following verse. Compare 2.10 and 1 Sam 13.1.
Although this is not done by Revised Standard Version or Good News Translation, a new paragraph should probably begin here, since the account of the capture of Zion breaks the continuity of the story, which is continued in verse 17. Such a break is made in New Jewish Publication Society’s Tanakh, New Jerusalem Bible, Revised English Bible, and Anchor Bible.
The words began to reign are intended to mark the time when David first became king.
The number forty is often used in the Old Testament as a round number to indicate a long period of time rather than a precise length of time. Israel wandered in the wilderness for forty years (Deut 2.7; Josh 5.6). Othniel (Judges 3.11), Gideon (Judges 8.28), Samuel (1 Sam 4.18), Saul (Acts 13.21), David, Solomon (1 Kgs 11.42), and Joash (2 Kgs 12.1) ruled for forty years (see also Judges 5.31). The Philistines ruled Israel for forty years (Judges 13.1), and God promised to punish Egypt for forty years (Ezek 29.11-13). Translators should keep the number forty in the text, but they may wish to state in a footnote that this may be a round number in Hebrew, indicating a long period of time.
Quoted with permission from Omanson, Roger L. and Ellington, John E. A Handbook on the First and Second Books of Samuel, Volume 2. (UBS Helps for Translators). New York: UBS, 2001. For this and other handbooks for translators see here .
