For MOSS 2007, we can find the details about the configuration database and the SQL server where it's hosted in the below path in the registry of the sharepoint server.
HKLM\Software\Microsoft\Shared Tools\Web Server Extensions\12.0\Secure\ConfigDb
This path is applicable for WSS 3.0 also.
When we are planning for the migration of the SQL server and we face any issue during that, we can validate if the sharepoint is pointing to the correct SQL server or not from the above path.
Hope this helps someone.