Home > other >  SQL Server Management Studio will not redirect output from command line
SQL Server Management Studio will not redirect output from command line

Time:01-16

I am using SQL Server Agent to run a few scripts regularly of type CmdExec with the following format: "Absolute path to RScript.exe" "Absolute path to script.R" > "Absolute path to log folder\logfilename.txt"

This line will work when used manually in the command prompt but won't create a log file when executed through SSMS. Anyone else have trouble dealing with SSMS or is there a problem with my line?

What also works (in the sense that a file is created) in SSMS is type nul > "Absolute path to log folder\logfilename.txt" so there is no problem with the file path or write permissions.

CodePudding user response:

Not sure if this piping is possible for "normal" commands, but under Step Properties -> Advanced, you can choose to save output to file

  • Related