Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
Dmh188
Starting Member
37 Posts |
Posted - 2012-01-05 : 14:14:43
|
| hey guys, so i am trying to get results of a stored procedure to save to a file that is FTP to my site. I have on idea how to do this. haha. i tried a batch file and came up with this:"sqlcmd -U un -P pw -d databse -S Serve -Q"creditmemoreturns" -o ofile.csv"This does save it as a csv file (havent specified a file path yet) but a few problems. First being it is not delimiting it by a comma like i want it to.. second i do not know how to then have the file sent through ftp. any help? |
|
|
X002548
Not Just a Number
15586 Posts |
|
|
Dmh188
Starting Member
37 Posts |
Posted - 2012-01-05 : 15:05:16
|
| when i run the batch as is it will save the results of the query in a csv file. Only problem is that csv is not comma seperated like i need it to be.. I could probably, once that issue is fixed, have a different batch file run to then ftp it where i need it to be.. but i need to results to be saved as a comma delimited file |
 |
|
|
X002548
Not Just a Number
15586 Posts |
|
|
Dmh188
Starting Member
37 Posts |
Posted - 2012-01-05 : 15:12:46
|
| I am not familiar with bcp. I just did a google search and it looks promising. Can i use this then to run the results, then i would assume save it on the server, then ftp it out? |
 |
|
|
X002548
Not Just a Number
15586 Posts |
|
|
Dmh188
Starting Member
37 Posts |
Posted - 2012-01-05 : 15:29:04
|
| creditmemoreturns is a stored procedure, would i just put it in single qoutes? and also is there a way to have this run automatically on a schedule |
 |
|
|
|
|
|