I don't know of any such attack. That doesn't mean no such attack ever existed -- just that nothing pops to mind at the moment.
There are a few others that are related, which you might possibly have been thinking of:
Back in the day, the "ping of death" was a malicious ICMP packet that crashed the recipient computer, but it did not allow execution of malicious code. Cisco routers were also vulnerable to an ICMP-related denial-of-service vulnerability, but that didn't allow malicious code execution, either.
The closest example I can think of is the SQL Slammer worm. Slammer was a single-packet worm: all it took to infect a vulnerable machine was to send a single malicious UDP packet. The worm exploited a vulnerability in MS SQL Server, which accepted packets via UDP and had a buffer overflow vulnerability in the code that parsed this packet. This vulnerability did allow execution of malicious code -- but it was not over ICMP.
None of these are similar to SQL injection in any way that I can think of.