Skip to content

Removing line prompts when running sqlcmd as a subprocess from a script on Linux #580

@HoundThe

Description

@HoundThe

I've tried to replace the legacy sqlcmd with the sqlcmd-go, but I've noticed a difference that I can't find in the documentation.

When running sqlcmd-go from a program, by creating a subprocess and writing/reading stdin/stdout a line prompts can be found in the output. This does not happen with original sqlcmd.

Example:
Program writes to the process stdin following commands:

  • SET NOCOUNT ON;
  • select * ...;
  • go
  • exit

Then the stdout output will look like this

1> 2> 3> 
<QUERY OUTPUT>
1> 

Is there a way to avoid this, while keeping the ability to interactively communicate commands via stdin/stdout as a subprocess?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions