The most popular solutions will be written python. You find some of the python code converted to other languages but not sql. A popular solution
https://github.com/derek73/python-nameparser
note: there ports of the code to c#, but are not as well maintained.