Id like to run mssql queries in a bash script with tsql command. Thats okay, i can connect and run manualy. I tried to save the result to a file with this script but no success.
> tsql -connection parameters- < tsql_input.sql > tsql_output.csv
where tsql_input.sql is :
select ... from .... ;
or
> tsql -connection parameters- < sql_cmd
where sql_cmd is :
echo "SELECT ... FROM ...;\n
GO\n
exit\n
" > out.csv
What did I miss ?