First real SQL Server project - report services stuff.

  • So, I've been learning a bit about SQL server 2005, and the report server end of it in particular lately, and I wanted to try kind of a demo project...

    We have log files created everyday reporting on how backups are working. What I want to do is create a report page that reads through the log file for the previous day and shows any lines with an error (I'll define all the types of errors) but that is basically all I want.

    I have done most of the tutorials for report server, and none of them have really talked about how to go find stuff in files (it seems like it is all table driven), but I feel like this should not be at all impossible, so I was wondering if anyone could point me in the right direction. I can learn a bit of TSQL (that would actually be a bonus to me, I'm a college student studing computer science, I'm just a database admin as a job to pay the bills right now!) Anyway, thanks for the help.

  • I am not aware of any direct way to read log files with Reporting Services. RS uses data sources to access the data, so unless you can setup a datasource to the log file, you will not be able to read it.

    Since you are using SQL Server and Reporting Services you likely have Integration Services as well. Your best solution is likely to import the files into a table and use the table as the source of the reports. Otherwise I think you will end up writing .NET code or other code to read the file as a stream and create data sets, which will be more work than its worth. Setup an SSIS job to import the log files daily and use the table as the source of the reports.

  • That sounds like a great plan, I had started going over my options on Friday, and it looks like it's either learning some c# (which people have a lot of concerns that it is slow on tables?..) or learn to make an SSIS for it. I'm actually going to try both, mostly for learning purposes, but i'll start with the SSIS setup... thanks

  • thre's a difference between "log" files created by some application, and SQL's log files...i think dmc was thinking the log files you are talking about are SQL's.

    if you have an application that is writing to a file on the results of whether a backup failed or not, that's different and a lot easier to work with.

    you can easily import those files as a table, and use WHERE statments to find errors.

    you can also open the FOLDER that the log files exist in as a linked server, and open each file in there as if it were a table.

    you might even change the application so it logs information to a table instead of a text file, so it's more easily accessible for reporting.

    a linked text server only likes .txt and .csv files, and ignores other extensions. to use that option, you would need to either rename the files, or copy them to have the right extensions.

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • Lowell (2/23/2009)


    you can easily import those files as a table, and use WHERE statments to find errors.

    How would I do this, these are in fact custom log files, but I don't know what program is producing them. I'm actually a student employee, and the guys I work for just kinda give me broad projects to work on and say "have fun"... it's a weird environment but basically I'm teaching myself everything. The first week they handed me SQL Server 2005 development and enterprise, showed me books online and told me enjoy. I've done most of the report services tutorials, and have started on Integration Services. I'm not really sure how to make triggers and stuff, and I don't know TSQL well at all, but it shouldn't be too hard I don't think, I did a lot of trigger based programming for computer games a few years ago, and it was actually much simpler than the java stuff I'm writing now. Anyway, thanks for any help!

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply