go-mssqldb
go-mssqldb copied to clipboard
Named Instance - Not using port sets hard requirement on SQL Server Browser
When working with named instances, the default mssql behavior is to use UDP on port 1434 with the SQL Server Browser to look up the port of the instance. However, when Browser Service is not running or blocked by firewall rules, no connection can be made. In other languages/drivers, this can be solved by passing the port explicitly. In this driver, even using:
sqlserver://{{username}}:{{password}}@
or
sqlserver://{{username}}:{{password}}@
In both cases, port specification is ignored by the driver (this is expected behavior according to the docs). This way no connection with the scenario above is possible.
I am also running into this same issue. The customer we are working with is blocking the use of the SQL Server Browser. We need to be able to supply both the Instance name and the port.
this could be the first PR that goes through in the Microsoft fork
Please take a look https://github.com/microsoft/go-mssqldb/pull/6