I frequent this site a lot but have never posted but here goes! I am fairly new only about a month in on the job but have had some experience with SQL before.
I have a simple query that runs monthly which counts the number of active members and notifications sent per Organization for the month.
I have created a one-step job with SQL SERVER AGENT that runs the query on the 5th of the month and records the information for the previous month.
I have the output of the job going to a file named MonthlyReport.txt. This .txt file is then mailed to the client.
The client opens the file with Excel as default... this removes all the formatting. I recommended opening Excel and importing the document and this has temporarily resolved the issue.
However, there are TWO very big issues: 1) asking the client to import the file for formatting is very inconvenient. Importing the file myself will create a lot of overhead as there are several of these reports for multiple databases.
2) the .txt file includes the lines "MonthlyReport' : Step 1, 'Collect Data' : Began Executing 2015-03-17 12:39:58"------ This really messes up the formatting of the column headers
I am looking for other ways to resolve this task by exporting directly to EXCEL or a formatted .txt file
I have tried saving the output as MonthlyReport.csv but the problems still remain and this requires importing into excel
FYI-- My company is running Windows Server 2012 which has SSIS functionality but we also are running a few legacy Windows Server 2008 R2 and I need the solution to work on both servers so SSIS packages are not compatible with Windows Server 2008.
I am sorry for the longwinded response and appreciate all the time and help that the community is able to provide.