You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Access MSSQL named instances without having to specify their port number #1082
Hi ! Could you check whether your issue is not a duplicate of #92 or #86 ? If so, could you comment directly on the original issue ?
Also, we recently added support for odbc, so you can also connect to your sql server database on windows using the native odbc driver that supports all SQL server connection methods.
I'm not really in a position to submit a pull request but for possible future upstreaming or whoever else encounters this issue you can just query the port using this
I figured out the problem by actually checking the network traffic on sqlcmd with wireshark.
Not sure if that's the right place for it. It also might be nice to cache the active port somewhere for use in cargo check with comptime query validation
Activity
lovasoa commentedon Nov 5, 2025
Hi ! Could you check whether your issue is not a duplicate of #92 or #86 ? If so, could you comment directly on the original issue ?
Also, we recently added support for odbc, so you can also connect to your sql server database on windows using the native odbc driver that supports all SQL server connection methods.
oreadflex commentedon Nov 5, 2025
I see now. So, when providing a named instance, it will not interrogate for a given port.
#86 (comment)
It was my understanding given this that we do not need to provide the port as it will be found automatically but based on #92 this is not implemented.
oreadflex commentedon Nov 5, 2025
I'm not really in a position to submit a pull request but for possible future upstreaming or whoever else encounters this issue you can just query the port using this
lovasoa commentedon Nov 5, 2025
Interesting, thanks for the snipper ! Is there a reference document where this is documented ?
The file to update is probably: https://github.com/sqlpage/sqlx-oldapi/blob/main/sqlx-core/src/mssql/connection/stream.rs
A pull request would be very welcome !
oreadflex commentedon Nov 5, 2025
You can read more about it here
I figured out the problem by actually checking the network traffic on sqlcmd with wireshark.
Not sure if that's the right place for it. It also might be nice to cache the active port somewhere for use in cargo check with comptime query validation
lovasoa commentedon Nov 5, 2025
Would you be available to test it if I implemented it ? There is no support for named instances in the official sqlserver docker image we use on ci.
lovasoa commentedon Nov 5, 2025
I had cursor attempt an implementation here: sqlpage/sqlx-oldapi#43
tmp: switch to sqlx-oldapi with named instance discovery
[-]Cannot reach MSSQL via SQLPage[/-][+]Access MSSQL named instances without having to specify their port number[/+]lovasoa commentedon Nov 6, 2025
Could you please test the new feature and give feedback on #1085 ?