Hi there,
had to rush some sql and am now going back to it due to a slow db
performance. I have a db for sales leads and have created 3 views based
on the data I need to produce.
However one o the views, which has subqueries to the other views is VERY
slow and it needs to be speeded up, but am unsure how, can anyone
help... below is the sql?
SELECT CGAMain.CGAMainId,CGAMain.Salutation,CGAMain.First Name,
CGAMain.LastName,CGAMain.Salutation2,CGAMain.First Name2,CGAMain.LastName
2,
cgamain.telephone,CGAMain.[Post Code],
other.dbo.users.UserName, other.dbo.agents.[agent_name],
LEADSTATUS.CURRENTSTATUS,leadstatus.activestatus,L eadstatus.[no
answer],CGAMain.rescode,
Agent_displayname As 'Called By'
FROM Leadstatus INNER JOIN CGAMain ON Leadstatus.CGAMainId =
CGAMain.CGAmainId
INNER JOIN other.dbo.users ON Leadstatus.LTAid = other.dbo.users.userref
INNER JOIN other.dbo.agents ON Leadstatus.agentid = other.dbo.agents.id
WHERE
(StatusAssigned = 1)
AND (leadstatus.activestatus = 'Active')
please help???
*** Sent via Developersdex
http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!