thank you for your help.
As suggested by Minty
1. I have now run the Query Execution plan on Query B and there was recommendations to create a covering index. this is something I did do initially because Query B produced the results instantaneously . anyway after creating the covering...
yes all indexed as I have run the Execution plan for recommendation and no suggestions from it . Originally before I split the 2 queries when it took 18 mins ,
I had to separate the Milestone related columns from the Original query and created a separate query B for Milestone . to my surprise...
Not at all because I am not combining rows . the rows for the separate queries give the same result which is ok . I need to combine the Columns as most of the the Column of Query A is different from Columns in Query B
someone suggested to use a LEFT join . but am thinking No because we will be going back to the original issue when the 2 queries together took 18mins . do u think this suggestion is correct
the 2 queries were 1 query before I split them because the 1 query was running for 18minutes . the split query individually now running much faster but 2 separate queries. I want the output as 1 query running optimally . how do I achieve this.
I cant UNION them because UNION is for combining...
Can someone please help .
I have 2 SELECT queries A and Query B ,
the 2 queries were 1 before I separated them due to running slow taking 18minutes .
I have now split the 2 queries and A runs in 25 secs , B runs instantly . Both produce same number of records
Question
What will be...
I agree with you and considered using at the onset of the Project but because of the "buts/complications " for example the fact that you cant modify base table without affecting view definition and having to drop it to remove dependencies etc so the answer is NO I haven't used it .
also...
Hi Wayne
thanks for your help in showing some insight .
this issue has now been resolved with the help of a few experts on this site .
and yes the views are now running perfect
all your comments re:
primary keys , Foreign keys
statistics
schema binding views
have all been taken into...
Minty
dont worry SSMS editor is not the issue . I know how to use it .Apologies and thank you for your help . tomorrow is another day to see what the issue is with the query in question
anyway I have tried the same on a simpler query as below and it runs with no issue .
its so...
ALTER PROCEDURE [dbo].[usp_AppProjectDetail]
AS
Declare @iCount as Int ;
SET @iCount = (select Count(X.*)
FROM
(
SELECT
Project.ProjID,
Quarters.QTR_ID,
UpldProjectDetail.ProjName,
Department.DepartmentID,
UpldProjectDetail.MultiPD...