microsoft / go-sqlcmd

The new sqlcmd, CLI for SQL Server and Azure SQL (winget install sqlcmd / sqlcmd create mssql / sqlcmd open ads)
https://learn.microsoft.com/sql/tools/sqlcmd/go-sqlcmd-utility
MIT License
334 stars 58 forks source link

Cannot stop other context #320

Open way0utwest opened 1 year ago

way0utwest commented 1 year ago

I had two contexts set up, and when I tried this code, I got an error:

sqlcmd stop mssql2

I would expect to be able to specify a context and stop it. Switching between them is a hassle.

The error is shown here: 2023-04-11 17_36_57-cmd

stuartpa commented 1 year ago

The user model here follows the patten for CLIs like kubectl, or oc (Open Shift CLI), to switch context just run:

sqlcmd use mssql2
way0utwest commented 1 year ago

I understand I can switch context, but switching, ending, then potentially switching back, is a hassle. I'd expect I could a paramaterize this.

I am assuming this is a design decision. Feel free to close or link to a future enhancement.