Geoff A code example worked fairly well on my machine.
My dev machine has four instances installed:
2008 standard (default).
The above query seems to have missed my 2005 SQL Express instance, which i clearly see did not place a key in the SOFTWARE\Microsoft\Microsoft SQL Server\InstalledInstances folder of the registry.
do you think it's caused by 2005 not putting a key there, or that Express instances don't put a key there?
i tried Netstat -a -b on a command line, and i see multiple sqlserver.exe's running and listing to various ports, but can't map them directly to their instances.
help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!