(23) باب مَنْ طَلَبَ الْوَلَدَ لِلْجِهَادِ
Narrated Abu Huraira:
Allah's Messenger (ﷺ) said, "Once Solomon, son of David said, '(By Allah) Tonight I will have sexual intercourse with one hundred (or ninety-nine) women each of whom will give birth to a knight who will fight in Allah's Cause.' On that a (i.e. if Allah wills) but he did not say, 'Allah willing.' Therefore only one of those women conceived and gave birth to a half-man. By Him in Whose Hands Muhammad's life is, if he had said, "Allah willing', (he would have begotten sons) allof whom would have been knights striving in Allah's Cause."
Reference: Sahih al-Bukhari 2819
In-book reference: Book 56, Hadith 35
USC-MSA web (English) reference(deprecated numbering scheme): Vol. 4, Book 52, Hadith 74