Community forum

Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
View
Go to last post Go to first unread
Offline Librus Prime  
#1 Posted : Friday, November 29, 2019 9:38:36 PM(UTC)
Librus Prime

Rank: Paid support

Joined: 11/6/2019(UTC)
Posts: 5
Canada
Location: Winnipeg, Manitoba

Thanks: 1 times
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
Offline Support  
#2 Posted : Sunday, December 1, 2019 1:41:16 PM(UTC)
Support

Rank: Official support

Joined: 2/23/2008(UTC)
Posts: 11,223

Thanks: 875 times
Was thanked: 446 time(s) in 424 post(s)
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!
Offline ErikC  
#3 Posted : Monday, December 2, 2019 7:32:00 AM(UTC)
ErikC

Rank: Paid support

Joined: 2/26/2008(UTC)
Posts: 1,520
Netherlands
Location: Amsterdam

Thanks: 114 times
Was thanked: 220 time(s) in 188 post(s)
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.
thanks 2 users thanked ErikC for this useful post.
Support on 12/2/2019(UTC), Librus Prime on 12/2/2019(UTC)
Users browsing this topic
Guest
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Scroll to Top