Skip to content

-G switch does not work #127

Open
Open
@apoorvdeshmukh

Description

@apoorvdeshmukh

-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 ''.

Metadata

Metadata

Assignees

Labels

SecuritybugSomething isn't workingsqlcmd switchswitch in existing sqlcmd

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions