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

Variables and colors don't work in context #324

Closed way0utwest closed 1 year ago

way0utwest commented 1 year ago

I was trying to get colors to work in a context mode, but more disturbing is I can't use variables. 2023-04-11 17_55_36-cmd

Repro: Run these from a CLI

  1. create an instance - cmd create mssql --accept-eula --using https://aka.ms/AdventureWorksLT.bak
  2. check things are running - sqlcmd query "select @@version
  3. try to check colors - sqlcmd query ":color list"
shueybubbles commented 1 year ago

What if you put a space between query and " ?

way0utwest commented 1 year ago

Nope, doesn't work. I know you don't have access to results, but how do you with sqlcmd mode and not go-sqlcmd mode? 2023-04-13 17_17_31-Variables and colors don't work in context · Issue #324 · microsoft_go-sqlcmd

shueybubbles commented 1 year ago

oh it's :list color

shueybubbles commented 1 year ago

example usage that works

10:13:08.52 e:\git\go-sqlcmd>set sqlcmdcolorscheme=emacs

10:13:14.09 e:\git\go-sqlcmd>sqlcmd query "select top (2) name from sys.objects

image