I am trying to get a count of all file numbers that are invalid in our tracking table to show trending.
To see if programming changes improve or worsen when implimented.
this is the script I wrote to count bad records from a prorticulr date forward.
the dbo.IsFileNumberValid is a function that returns 0 or 1 depending on pass/fail.
One problem with this approach is that the script take a looong time to run. (6 minutes)
Results:
any suggestions on how to speed this up?
Thanks
John Fuhrman
To see if programming changes improve or worsen when implimented.
this is the script I wrote to count bad records from a prorticulr date forward.
Code:
Select
Year(TrackingDate) As 'Year',
Month(TrackingDate) As 'Month',
count(Tracking_ID) As 'Number of Bad A file Numbers'
From dbo.tblTrackingTable
WHERE
(dbo.IsFileNumberValid(FileNumber) = 0)
AND (TrackingDate > CONVERT(DATETIME, '2010-06-01 00:00:00', 102))
AND (FileNumber <> '.BOX.END.')
Group By Year(TrackingDate), Month(TrackingDate)
ORDER BY Year(TrackingDate), Month(TrackingDate)
the dbo.IsFileNumberValid is a function that returns 0 or 1 depending on pass/fail.
One problem with this approach is that the script take a looong time to run. (6 minutes)
Results:
Code:
2010 6 204
2010 7 17
2010 8 9
2010 9 6
2010 10 6
2010 11 9
2010 12 1
any suggestions on how to speed this up?
Thanks
John Fuhrman