-
Notifications
You must be signed in to change notification settings - Fork 77
Description
My customer runs sqlcmd -L and it returns strange string like following:
Servers:
;UID:Login ID=?;PWD:Password=?;Trusted_Connection:Use Integrated Security=?;*APP:AppName=?;*WSID:WorkStation ID=?;
The issue can be reproduced in my server with sqlcmd shipped with SQL 2019, SQL 2022. The issue also exists when I use go-sqlcmd:
C:\Windows\System32>sqlcmd -?
Version v1.4.0
C:\Windows\System32>sqlcmd -L
Servers:
;UID:Login ID=?;PWD:Password=?;Trusted_Connection:Use Integrated Security=?;*APP:AppName=?;*WSID:WorkStation ID=?;
I debuged the sqlcmd shipped with SQL 2022. The issue is that when sqlcmd tries to fetch server list from return result of SQLBrowseConnectW of driver (this is msodbcsql), it could not handling well when there is no server name between { and } in the result. But I think go-sqlcmd might not use msodbcsql. Not sure if it also hit the same string handling problem. Please help to have a check on the issue.