Yeah, I know. I am going to assume that the server is browseable and the documentation will just state that if you are installed 2k5 express on a server you have to make sure it is browseable. I need to enumerate the servers properly so the user can select which server they need to connect to.
OSQL.EXE was one solution suggested in the past and that works. Only problem with that is:
1) It is installed with a SQL Server component (and I do not think it is installed with the native client but rather the server)
2) Given 1), I doubt I can distribute OSQL.EXE with my app to do the test
3) OSQL runs in DOS so that would cause a DOS window to flash while it's doing its thing...
Menachem
>I don't think you would be able to enumerate them under all circumstances because SQL 2005 and later installation by default disables SQL Server Browser service which makes enumeration possible.
>
>>I know there was a thread on this 5 years ago but I the solutions presented there are not quite working for me.
>>
>>I need a means to enumerate and list all the SQL Server accessible to a machine. The solution I saw uses NetServerEnum() which I guess worked fine for SQL Server 2000 but it doesn't properly return names of servers + instances as used by SQL Server 2005.
>>
>>Any ideas?
>>
>>PS, I would prefer not to rely on any SQL Server functionality existing on the machine...
>>
>>Thanks in advance