Wouldn't it be useful to be able to clear the current context? #370
Closed
MasayukiOzawa
started this conversation in
Ideas
Replies: 1 comment 1 reply
-
This is happening because we expect username and password to come together either from environment variables or from sqlconfig file as mentioned here. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
When a SQL Server container is created with sqlcmd create, a definition for the automatically created environment is added to sqlconfig and the currentcontext is set.
When connecting to the created environment / using sqlconfig, the information registered in sqlconfig is very useful.
However, if you want to run sqlcmd as a conventional use of sqlcmd, the inclusion of the currentcontext information will result in a different feel for specifying user information than in the past.
If sqlconfig exists with currentcontext set, the password setting seems to override the context password, and setting SQLCMDPASSWORD is ignored.
If currentcontext is set, the following command will result in unexpected login behavior.
The expected logon is with the password for $ENV:SQLCMDPASSWORD, but if currentsqlcontext exists in sqlconfig, the logon is done with the password for the specified context.
If the currentcontext setting can be cleared with a command such as
sqlcmd config clear-current-context
, then even if sqlconfig is set, logins will be the same as before sqlconfig was set.Beta Was this translation helpful? Give feedback.
All reactions