Skip to main content

I am trying to use a pipe filename to communicate with the sqlcmd command so i can continuously feed it sql commands.

So my filename looks like this:  | cmd /k sqlcmd -o output-filename

I can sucessfully communicate back and forth with sqlcmd so that works fine,

My problem is when i open the file it creates a console window.

Is there anyway i can prevent the console window from popping up?

Thanks in advance for any help.

I am compiling to INT/GNT using Visual Studio (Version 7)


#SQL
#pipe
#VisualCOBOL
#Filehandling

I am trying to use a pipe filename to communicate with the sqlcmd command so i can continuously feed it sql commands.

So my filename looks like this:  | cmd /k sqlcmd -o output-filename

I can sucessfully communicate back and forth with sqlcmd so that works fine,

My problem is when i open the file it creates a console window.

Is there anyway i can prevent the console window from popping up?

Thanks in advance for any help.

I am compiling to INT/GNT using Visual Studio (Version 7)


#SQL
#pipe
#VisualCOBOL
#Filehandling

Does changing the cmd /k option to cmd /c help?

Have you tried piping the output directly to sqlcmd without invoking the command processor?

How about adding redirection to the end of the command ? i.e.  "2>&1"


Does changing the cmd /k option to cmd /c help?

Have you tried piping the output directly to sqlcmd without invoking the command processor?

How about adding redirection to the end of the command ? i.e.  "2>&1"

I did try a system command but If I do that i need to start sqlcmd every time and it is too slow