Good afternoon colleagues, I need your help to know what is happening with my JOB
since it does not perform the action I want. I commented that I made a Stored Procedure
to send a JOB
call which executes a command line SQLCMD
to create a file .txt
with the information of a query, however you are not creating the file .txt
, then I leave the information:
Stored Procedure
CREATE PROC testjob
AS
EXEC msdb.dbo.sp_start_job N'GetDataFromPagos'
SQLCMD
sqlcmd -S myserver -U "sa" -P "Password" -d clientes -Q "SELECT TOP 5 * FROM CLIENTES..PAGOS" -o C:\Employees.txt
I do not know if I need to perform any other action, at the moment of executing my stored procedure
it shows me the following message:
Job 'GetDataFromPagos' started successfully.
Apparently it says that it starts successfully, however I do not know what is missing so that I can create the file.
Additional Note : I commented that I executed the SQLCMD
from the command line ( cmd
) and it worked correctly.
Your help is appreciated. Greetings.