I've created a SQL query (c:\myscript.sql) which is fairly complex. I'd like to email the results of that query each night.
I've created a job that uses the code below. The code below has the SQL inserted into it. I'd like to reference the file I created so that I can update that file as needed and not have to worry about going into this job and updating in there as well.
@subject ='Message Subject',@profile_name ='DatabaseMailProfile',@query ='SELECT Name FROM Members',
@attach_query_result_as_file = 0