I used the solution with the version of "SET NOCOUNT ON". But the stored procedure was completed and stopped abruptly. So I decided to use the shell using the sqlcmd command. Here I made a function:
callStoredProc = function(server,BD,storedProc,sParams){ sFileName = paste("log_",gsub(":", "_", gsub("-", "_", gsub("\\.", "_", Sys.time()))),storedProc,".txt",sep="") sQuery = paste("sqlcmd -E -S ",server," -d ",BD," -Q \"EXECUTE ",storedProc," ",sParams,"\" -o \"",sFileName,"\"", sep="") shell(sQuery) }
source share