Sunan Ibn Majah, Book 20, Hadith 5 (Ibn Majah 2539)
It was narrated from Ibn `Umar that the Messenger of Allah (ﷺ) said:
“Carrying out one of the legal punishments prescribed by Allah (SWT) is better than if it were to rain for forty nights in the land of Allah (SWT), Glorified is He.”