Converting SQLCMD to VisualCron Tasks - VisualCron - Forum

Community forum

Librus Prime
2019-11-29T20:38:36Z
I would like to convert the below into VisualCron Tasks.
sqlcmd -U MYUSER -P MYPASS -S MYSQLINSTANCE -d MYDB1 -Q "EXEC sp_MYSTOREDPROC" >> \\SERVER\FOLDER\MYOUTPUT.CSV -W -s"," -w 999 -h -1
sqlcmd -U MYUSER -P MYPASS -S MYSQLINSTANCE -d MYDB2 -Q "EXEC sp_MYSTOREDPROC" >> \\SERVER\FOLDER\MYOUTPUT.CSV -W -s"," -w 999 -h -1
sqlcmd -U MYUSER -P MYPASS -S MYSQLINSTANCE -d MYDB3 -Q "EXEC sp_MYSTOREDPROC" >> \\SERVER\FOLDER\MYOUTPUT.CSV -W -s"," -w 999 -h -1

I've tried various task combinations but I always end up with extra instances of column headers in the output file.
I would like to only have 1 instance of the column header in the file output.

R
Support
2019-12-01T12:41:16Z
Hi,

I see a couple of alternatives;

1. use the existing Execute Task, it will simulate what you do today
2. that we implement a way that can read byte array into stored procedure: https://docs.microsoft.c...ing-an-image-from-a-file 

If you are interested in converting the query to a stored procedure we can investigate the possibility to create function to read value through a Variable. Please let us know.
Henrik
Support
http://www.visualcron.com 
Please like  VisualCron on facebook!
ErikC
2019-12-02T06:32:00Z
Hi,

In the SQL task there is a checkbox in the Output tab to exclude the field names.
Use that and you are good to go, one task having the field names and not for the other tasks.

Regards,
Erik

Uses Visualcron since 2006.
Scroll to Top