This is Part II of my post, Rest, Then Centralization. Please read that if you want background information for this post.
Okay, why is it that the Deuteronomist in II Samuel 7:13 makes the generalized zera of v 12 refer specifically to Solomon, who will build a house for God’s name? I think part of the answer is this: the II Samuel 7 that was in front of the Deuteronomist said that David didn’t build the temple. That was puzzling in the ancient world, for kings worth anything built temples. You can tell that the Deuteronomist was concerned about this issue from I Kings 5:3-5, which says that David didn’t build the temple because he was a man of war, so Solomon will build it because the LORD has given him rest from his enemies. The Deuteronomist was addressing an issue that people had: Why did Solomon and not David build the temple?
The Deuteronomist looked at II Samuel 7 and saw the following: David offers to build God a house, God tells David “no” because he’s never dwelt in a house, and God promises to build David a house, an everlasting dynasty. The document in front of the Deuteronomist may be from the time of David, which is why it doesn’t mention that Solomon would build the temple. Or it came long after David and was anti-temple, for whatever reason.
But the Deuteronomist doesn’t like II Samuel 7 not mentioning the temple, for he’s big on the central sanctuary. And so he inserts v 13, which says that Solomon will build it. He also goes to I Kings 8 and ties that chapter with II Samuel 7, the chapter he had before him plus his additions.