I have converted a standard MS access query to a stored procedure but am experiencing diabolical performance.
why is this SP running so badly?
Thanks
1DMF
"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you."
"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!"
MIME::Lite TLS Email Encryption - Perl v0.02 beta
why is this SP running so badly?
Code:
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
-- Insert statements for procedure here
SELECT dbo.vCaseCheckerMain.Documents_Override, dbo.vCaseCheckerMain.Case_ID, dbo.vCaseCheckerMain.Check_Type, dbo.vCaseCheckerMain.Flag_Date, dbo.vCaseCheckerMain.CNames, dbo.vCaseCheckerMain.Category, dbo.vCaseCheckerMain.Status, dbo.vCaseCheckerMain.CompanyName, dbo.vCaseCheckerMain.FirstName, dbo.vCaseCheckerMain.LastName, dbo.vCaseCheckerMain.[Compliance Officer], dbo.vCaseCheckerMain.Rating, dbo.vCaseCheckerMain.Due_Date, dbo.vCaseCheckerMain.Final_Rating, dbo.vCaseCheckerMain.Assigned, dbo.vCaseCheckerMain.Reason, dbo.vCaseCheckerMain.Documents, dbo.vCaseCheckerMain.Override_By, dbo.vCaseCheckerMain.Override_Reason
FROM dbo.vCaseCheckerMain
GROUP BY dbo.vCaseCheckerMain.Documents_Override, dbo.vCaseCheckerMain.Case_ID, dbo.vCaseCheckerMain.Check_Type, dbo.vCaseCheckerMain.Flag_Date, dbo.vCaseCheckerMain.CNames, dbo.vCaseCheckerMain.Category, dbo.vCaseCheckerMain.Status, dbo.vCaseCheckerMain.CompanyName, dbo.vCaseCheckerMain.FirstName, dbo.vCaseCheckerMain.LastName, dbo.vCaseCheckerMain.[Compliance Officer], dbo.vCaseCheckerMain.Rating, dbo.vCaseCheckerMain.Due_Date, dbo.vCaseCheckerMain.Final_Rating, dbo.vCaseCheckerMain.Assigned, dbo.vCaseCheckerMain.Reason, dbo.vCaseCheckerMain.Documents, dbo.vCaseCheckerMain.Override_By, dbo.vCaseCheckerMain.Override_Reason
HAVING (((dbo.vCaseCheckerMain.Rating) Is Null Or (dbo.vCaseCheckerMain.Rating)<>1))
ORDER BY dbo.vCaseCheckerMain.Documents_Override DESC , dbo.vCaseCheckerMain.Case_ID;
END
Thanks
1DMF
"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you."
"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!"
MIME::Lite TLS Email Encryption - Perl v0.02 beta