I can't get an particular SQL query to export to txt file. The powershell script I have works for all other sql queries and what the script does is export the query results to a txt file.I have administrative rights on my server and below is the sql query.
INNER JOIN msdb..sysjobs ON msdb..sysjobs.job_id= msdb..sysjobhistory.job_id
I also have error catch statement on my powershell but it never returns any errors.
But I never any get any results back from the server. Is this a security issue any ideas?