Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LocalDB connections #470

Open
thorstenkampe opened this issue Oct 19, 2023 · 5 comments
Open

LocalDB connections #470

thorstenkampe opened this issue Oct 19, 2023 · 5 comments
Assignees
Labels
bug Something isn't working connectivity
Milestone

Comments

@thorstenkampe
Copy link

Will go-sqlcmd support LocalDB connections on Windows? (Basically the equivalent to sqlcmd -S (localdb)\MSSQLLocalDB -E.)

On Windows I get the following error with the latest go-sqlcmd 1.4.0: "no named pipe instance matching 'MSSQLLOCALDB' returned from host '(localdb)'".

@stuartpa
Copy link
Collaborator

It would be great to fix this. Is it something we need to fix in the underlying go-mssqldb driver?

@shueybubbles
Copy link
Collaborator

I don't know if it needs to be in the driver. I think there's some logic needed to calculate the right pipe name to connect to.
We'd probably only support automatic instances that are started externally.
The documentation shows how you may be able to connect using go-sqlcmd today by doing the pipe name calculation yourself.

eg np:\\.\pipe\LOCALDB#F365A78E\tsql\query

@stuartpa
Copy link
Collaborator

C:\Program Files\Microsoft SQL Server\150\Tools\Binn>SqlLocalDB.exe info MSSQLLocalDB
Name:               MSSQLLocalDb
Version:            15.0.4153.1
Shared name:
Owner:              REDMOND\******
Auto-create:        Yes
State:              Running
Last start time:    24/10/2023 06:15:04
Instance pipe name: np:\\.\pipe\LOCALDB#4B62CD62\tsql\query

C:\>sqlcmd -S np:\\.\pipe\LOCALDB#4B62CD62\tsql\query
Access is denied.
Access is denied.

C:\>"C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn\SQLCMD.EXE" -S np:\\.\pipe\LOCALDB#4B62CD62\tsql\query
1>

I get "Access Denied" when using the correct np (obtained from SqlLocalDB.exe) with go-sqlcmd. It works fine with the ODBC version.

@stuartpa stuartpa self-assigned this Oct 24, 2023
@dlevy-msft dlevy-msft added bug Something isn't working connectivity labels Nov 28, 2023
@dlevy-msft dlevy-msft added this to the Backlog milestone Nov 28, 2023
@willsbctm
Copy link

I had to uninstall the sqlcmd go version and use sqlcmd ODBC version =(

That's the solution (not good) that I found.

@weberms
Copy link

weberms commented Jul 28, 2024

I'm having the same issue. When is this being pulled from backlog and fixed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working connectivity
Projects
None yet
Development

No branches or pull requests

6 participants