microsoft / microsoft/go-sqlcmd

-G switch does not work

Open
#127 1 comment 1 reaction 1 assignee View on GitHub

@shueybubbles is already working on this.

Since Oct 3, 2022.

bug Security sqlcmd switch
Dominant language
Go
Stars
595
Forks
91
Avg merge
9h 35m
Merged PRs (30d)
1

Description

-G switch appears to be broken when using ActiveDirectoryDefault credentials (No username password explicitly specified).
There also appears to be a discrepancy in documentation.
-G along with -U does not ask for password prompt and simply returns error for both ODBC and go based sqlcmd.

ODBC go sqlcmd

>sqlcmd -G
1> select @@version
2> go



------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Microsoft SQL Server 2019 (RTM-GDR) (KB5014356) - 15.0.2095.3 (X64)
        Apr 29 2022 18:00:13
        Copyright (C) 2019 Microsoft Corporation
        Developer Edition (64-bit) on Windows 10 Enterprise 10.0 <X64> (Build 22000: ) (Hypervisor)


(1 rows affected)

>sqlcmd -G -U sa
Sqlcmd: Error: Microsoft ODBC Driver 17 for SQL Server : Login failed for user ''..

go-sqlcmd

\go-sqlcmd>.\sqlcmd.exe -G
mssql: login error: Login failed for user ''.

\go-sqlcmd>.\sqlcmd.exe -U sa
Password:
1> exit

\go-sqlcmd>.\sqlcmd.exe -U sa -G
mssql: login error: Login failed for user ''.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.