Good day everyone. I am attempting to construct a SQL Job that pulls a set of information included below.
I then want to email this information the specific email addresses associated with the "area" number. I would be fine emailing it as a txt file but would prefer a csv file.
Each email would contain a file attached which would contain 1 or more rows depending on how many rows are listed for that "area" in the information pulled from the View listed below.
If there is an area that has no rows listed, send an email but state in the body of the email that no files are listed.
The sample data attached contains information to send out for area 1, 3, 6, 9, 26. This information is pulled directly from a View in one of our DBs. I want emails to go out to the remainder of the 32 areas stating in the body that there is no data to send them for the month.
NOTE: The email addresses these emails will go to are already known. They will be pulled from the View as well.