Maybe it is not in a lot of the "stories", but there are only four Sherlock Holmes novels and it is all through one of them.
"Hence the cocaine. I cannot live without brain-work. What else is there to live for?"
"For me," said Sherlock Holmes, "there still remains the cocaine-bottle." And he stretched his long white hand up for it."
"...buried among his old books, and alternating from week to week between cocaine and ambition, the drowsiness of the drug, and the fierce energy of his own keen nature."
[The Sign of Four]