When Solomon needed the king of the demons to help build the Temple without iron, he sent his captain Benaiah son of Jehoiada into the wilderness. Benaiah carried two weapons that no demon could resist: a chain and a ring, and upon each was engraved Shem HaMeforash, the Ineffable Name of God.
Benaiah also carried a fleece of wool, some skins, and wine.
He found the pit where Ashmedai, king of the shedim, came each day to drink. Benaiah dug a lower pit, drained off the water, and plugged the channel with the fleece. Then he dug a higher pit and filled it with wine, letting the wine run down into Ashmedai's cistern. He smoothed the ground so the demon would suspect nothing, climbed a tree, and waited.
Ashmedai arrived. He checked his seal, untouched. He lifted the stone. And found wine. He hesitated. "Wine is a mocker; strong drink is raging" (Proverbs 20:1), he muttered. "Whoredom and wine and new wine take away the heart" (Hosea 4:11).
But he was thirsty. He drank. He drank more. And then the king of the demons lay down in his pit and slept.
Benaiah dropped from the tree and looped the chain around Ashmedai's neck. The demon woke roaring, wrenching at the chain, until he saw the Name engraved in the iron. At that he went quiet. The Name of God holds even the strong (Gittin 68a).
The lesson is not that demons can be outsmarted. It is that a holy Name, spoken rightly, binds even what seems unbindable.
Solomon thereupon sent Benaiab, the son of Jehoiada, provided with a magic chain and ring, upon both of which the name of God was engraved. He also provided him with a fleece of wool and sundry skins with wine. Then Benaiah went and sank a pit below that of Ashmedai, into which he drained off the water and plugged the duct between with the fleece. Then he set to and dug another hole higher up with a channel leading into the emptied pit of Ashmedia, by means of which the pit was filled with the wine he had brought. After leveling the ground so as not to rouse suspicion, he withdrew to a tree close by, so as to watch the result and wait his opportunity. After a while Ashmedai came, and examined the seal, when, seeing it all right, he raised the stone, and to his surprise found wine in the pit. For a time he stood muttering and saying, it is written, " Wine is a mocker: strong drink is raging, and whosoever is deceived thereby is not wise." And again, " Whoredom and wine and new wine take away the heart." Therefore at first he was unwilling to drink, but being thirsty, he could not long resist the temptation. He proceeded to drink therefore, when, becoming intoxicated, he lay down to sleep. Then Benaiah, came forth from his ambush, and stealthily approaching, fastened the chain round the sleeper's neck. Ashmedai, when he awoke, began to fret and fume, and would have torn off the chain that bound him, had not Benaiah warned him, saying, "The name of