|
Export SQL Server Agent job history (Development | SQL)
The following query is a good starting point if you want to export the SQL Server Agent job history to a file and you’re still using Enterprise Manager from SQL Server 2000. In SQL Server Management Studio from SQL Server 2005 there’s already a command available to do this in the Log File Viewer window accessible from the View History command on the selected job.
USE msdb SELECT J.name, S.step_id, S.step_name, H.message, run_status = CASE H.run_status WHEN 0 THEN 'Failed' WHEN 1 THEN 'Succeeded' WHEN 2 THEN 'Retry' WHEN 3 THEN 'Canceled' WHEN 4 THEN 'In progress' END, H.run_date, H.run_time, H.run_duration FROM sysjobhistory H INNER JOIN sysjobsteps S ON H.step_id = S.step_id AND H.job_id = S.job_id INNER JOIN sysjobs J ON J.job_id = H.job_id ORDER BY H.job_id, H.run_date, H.run_time, S.step_id
3/22/2006 11:42:26 PM (Central Europe Standard Time, UTC+01:00)
Unit testing for beginners (Development | .NET | Personal | Education)
Ever since I attended a lecture on test driven development I’ve been trying to find a way to use its essential part – unit testing – in real development environment. I realized this isn’t completely trivial after assigning a developer to write ad hoc unit tests for the class library of a recent project and failing at it completely because the tests turned out to make sure the method functionality wouldn’t change instead of making sure the functionality is actually correct.
Since a new project is coming up and we really need more security when changing the code in its later phases I decided to dedicate some more time to exploring and deriving the concepts of using unit testing in a not really development driven project. Well, I happened to stumble upon Pragmatic Unit Testing in C# with NUnit, a book which turned out to be a perfect answer to my questions. All that’s left now is to make the developers read the book and grasp its concepts before starting their work on the project.
In a few months you’ll probably be able to read here how it turned out. In the meantime I recommend the book to everyone who wants to start with unit testing but just doesn’t know how to do it.
3/22/2006 11:04:36 PM (Central Europe Standard Time, UTC+01:00)
|