I am debugging some code that builds a SQL command which runs successfully.
However at the end of the query it looks as if the results of the query are written to a text file.
The full query is below
echo SELECT DATE,DATETABLE,DATE,APPDATE FROM CTD_ADF WHERE DATE IN (20130911) > sql.txt && sql -h-1 -i sql.txt && del sql.txt
I assume the > sql.text
is basically saying create and write the results to a text file called sql.text?
And, at the end && del sql.txt
deletes the sql.text file at the end of execution?
But what does the && sql -h-1 -i sql.txt
commands do / mean?
I've tried researching the -h-1 -i
commands but so far have not managed to find an answer.
This is like using SQLCMD
-h -1
suppresses the column headers, and-i
specify the input file, which is sql.txt
You can further check the syntax of sqlcmd Utility see if this is the case.