rprussell
Posts: 38
Joined: Tue Feb 24, 2009 5:34 pm

BrowseSqlServers not returning all servers...

Hi, again -

We just learned that for some of the machines on our network, BrowseSqlServers is omitting the instance name attached to the server.

Example: I know that we have a machine with a SQL Express 2008 instance named "MACHINE\SQLEXPRESS"

I have a button hooked up to invoke BrowseSqlServers with the property [SqlServerBrowseMethod] set to "2"

It is returning a number of machines with correct Instance names attached - but there are also notably many machines listed with their instance names missing. Trying to test a connection to any of these results in an ODBC timeout.

Is there another parameter or property I need to set to get the full information for each machine?

Thanks,
Rob
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: BrowseSqlServers not returning all servers...

Hi Rob,

Do the servers with the problem perform a broadcast on the network to announce that they are available? Please note that the browse SQL servers feature detects the servers which announced their presence, it doesn't try to connect to each server to see if it's active or not. Also, a server may not become active immediately after its machine is started.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
rprussell
Posts: 38
Joined: Tue Feb 24, 2009 5:34 pm

Re: BrowseSqlServers not returning all servers...

Good question. I'm not our IT guy, and he's gone for the week.

Can you tell me how I'd check on a workstation whether SQL Express is broadcasting?

Note - I am seeing the machine name, just not the instance after it. In my example, "MACHINE\SQLEXPRESS" reports simply as "MACHINE"

R
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: BrowseSqlServers not returning all servers...

Hi,
Can you tell me how I'd check on a workstation whether SQL Express is broadcasting?
You can try using SQL Management Studio. After it starts you can use the "Server Name" combo to browse for more servers and see if your servers are discovered correctly.
Note - I am seeing the machine name, just not the instance after it. In my example, "MACHINE\SQLEXPRESS" reports simply as "MACHINE"
Is the SQL browsing service started? If it's not, only the server name is shown.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
rprussell
Posts: 38
Joined: Tue Feb 24, 2009 5:34 pm

Re: BrowseSqlServers not returning all servers...

cosmin wrote:Hi,
You can try using SQL Management Studio. After it starts you can use the "Server Name" combo to browse for more servers and see if your servers are discovered correctly.
Yes, they are being seen just fine, instance names and all.
Is the SQL browsing service started? If it's not, only the server name is shown.
On my PC, or the PC I'm trying to see? It was not started on mine, but starting it here made no difference; I changed [SqlServerBrowseMethod] to "1" but I still only get the machine name for certain servers I know have instance IDs attached to them.

I'll check that service on the destination machines as well.

Thanks, as always, for your help!

R
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: BrowseSqlServers not returning all servers...

Hi,
Yes, they are being seen just fine, instance names and all.
Does this happen on the machine which shows the problem during the install process?
On my PC, or the PC I'm trying to see?
The service should be started on both.
I changed [SqlServerBrowseMethod] to "1" but I still only get the machine name for certain servers
Please note that this mode shows only the server name. To show the instance ID the "SqlServerBrowseMethod" property needs to be set to "2".

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
rprussell
Posts: 38
Joined: Tue Feb 24, 2009 5:34 pm

Re: BrowseSqlServers not returning all servers...

Okay - interesting.

When I started the SQL Browser service on my PC, it took about 10 mins or so, but then the AI dropdown became chock full of info - EVERYTHING showed up - this was without checking the browser service status on any of the other machines.

The problem I'm foreseeing is that on our clients, we cannot guarantee even the existence of this service, let alone whether it's running.

(thinking...)

R
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: BrowseSqlServers not returning all servers...

Hi,

I'm afraid that the instance names can be seen only if the browsing service is started (this is an ODBC limitation). Otherwise, only the server names are shown. However, I'm not sure why you need to browse the instances. If there is one instance the server name should be enough and if there are multiple instances the user can specify it manually or start the browsing service.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
rprussell
Posts: 38
Joined: Tue Feb 24, 2009 5:34 pm

Re: BrowseSqlServers not returning all servers...

cosmin wrote:Hi,

I'm afraid that the instance names can be seen only if the browsing service is started (this is an ODBC limitation). Otherwise, only the server names are shown. However, I'm not sure why you need to browse the instances. If there is one instance the server name should be enough and if there are multiple instances the user can specify it manually or start the browsing service.

Regards,
Cosmin
Perhaps a tangent, here - I am able to write a .NET routine that can successfully see all the fully qualified names - can you suggest a way to get that information into the installer UI?

The reason I've had to go down this path is that with instances that aren't named MSSQLSERVER, I'm getting an ODBC Timeout trying to connect, whether using the built-in test connection feature, or with our own software. So what happens is we'll see "MACHINE" in the list, select that for our database installation, and then later on fail to connect to it because it needed to be "MACHINE\SQLEXPRESS" instead. I agree that the server name "should" be enough, but sadly that's not the case.

R
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: BrowseSqlServers not returning all servers...

Hi,
I am able to write a .NET routine that can successfully see all the fully qualified names - can you suggest a way to get that information into the installer UI?
Unfortunately .NET Installer Class Actions cannot pass information to the install process. However, you can try using a C++ DLL custom action. You can find a sample here. This custom action can set installer properties which can then be used to populate a combo or list.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”