Re: Bug with instanceName property?
- From: "Angel Saenz-Badillos[MS]" <angelsa@xxxxxxxxxxxxxxxxxxxx>
- Date: Fri, 13 Jan 2006 12:52:35 -0800
This is actually easier to explain in pseudo code. It works something like:
If you specify a portnumber attempt to connect using port number.
//attempt to connect 1 round trip.
else if you specify instance name
Query SqlBrowser for port number of instance name specified //1
roundtrip
//attempt to connect. 2nd round trip
It is much cheaper for us to connect to a server when you specify the port
number (1 round trip versus 2), so every time you specify a port number we
will avoid the roundtrip to query the sqlbrowser (ignore the instance name
you specify) and attempt to connect to the server on the port you specify.
Does this make sense?
--
Angel Saenz-Badillos [MS] DataWorks
This posting is provided "AS IS", with no warranties, and confers no
rights.Please do not send email directly to this alias.
This alias is for newsgroup purposes only.
I am now blogging: http://weblogs.asp.net/angelsb/
"Wes Clark" <WesClark@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:DF398F67-AE3B-4412-9CED-72A41EAB35D8@xxxxxxxxxxxxxxxx
>I appreciate your speedy reply. What is the relationship between the
> instanceName and the port number? I installed SQL Server 2005 on a
> machine
> that already had SQL Server 2000 on it, so that's why I gave it an
> instance
> name different from the default. I've also read that by specifying the
> port,
> you get a more efficient connection since it doesn't need to connect to
> the
> SQL Browser service first.
>
> I see now from the help file on the Network Configuration help file that
> named instances always use dynamic ports, so when I specify the port 1433,
> I
> am specifically requested the default instance on that box. Perhaps the
> documentation for port number and instanceName could mention that
> non-default
> instance names always use dynamic ports, so that specifying a port doesn't
> make sense.
>
> What is interesting is the connection will succeed unless I specify a
> database name. To wit,
> jdbc:sqlserver://ITH:1433;instanceName=SQLSERVER2005;user=sa;password=123;
> Connected!
>
> Kind of strange. I suggest the
> jdbc:sqlserver://ITH:1433;instanceName=SQLSERVER2005;forwardReadOnlyMethod=direct;user=sa;password=123;
> Connected!
> jdbc:sqlserver://ITH:1433;instanceName=SQLSERVER2005;forwardReadOnlyMethod=direct;databaseName=cc;user=sa;password=123;
> com.microsoft.sqlserver.jdbc.SQLServerException: Failed
> Logon:com.microsoft.sqlserver.jdbc.SQLServerException: Cannot open
> database
> requested in login 'cc'. Login fails.
>
> I can confirm what you are saying, however, by removing the port
> specification when I use the instanceName parameter syntax:
> jdbc:sqlserver://ITH;instanceName=SQLSERVER2005;user=sa;forwardReadOnlyMethod=direct;databaseName=cc;password=123
> Connected!
>
.
- References:
- Re: Bug with instanceName property?
- From: Angel Saenz-Badillos[MS]
- Re: Bug with instanceName property?
- Prev by Date: Re: Encrypted JDBC between JAVA Middletier and MSSQL Server
- Next by Date: Re: Bug with instanceName property?
- Previous by thread: Re: Bug with instanceName property?
- Next by thread: Re: Bug with instanceName property?
- Index(es):
Relevant Pages
|