OrWolf
MIS
- Mar 19, 2001
- 291
Hi All,
I have a SQL view that contains a CASE statement to identify is a given value is not null in which case the result shown is a simple asterisk, otherwise nothing. This is used to identify a primary contact that is linked to an organization. The problem is that while helping the users of my .NET application it slows down the view by 75%. Does any one have any idea that will give me the same result but improve performance?
View Syntax:
SELECT Person.PersonID, Person.FirstName, Person.LastName, CASE WHEN Organization.OrganizationID IS NULL THEN '' ELSE '*' END AS PrimaryContactFlag
FROM Person
LEFT OUTER JOIN Organization ON Person.PersonID = Organization.PrimaryContactID
Thank you
I have a SQL view that contains a CASE statement to identify is a given value is not null in which case the result shown is a simple asterisk, otherwise nothing. This is used to identify a primary contact that is linked to an organization. The problem is that while helping the users of my .NET application it slows down the view by 75%. Does any one have any idea that will give me the same result but improve performance?
View Syntax:
SELECT Person.PersonID, Person.FirstName, Person.LastName, CASE WHEN Organization.OrganizationID IS NULL THEN '' ELSE '*' END AS PrimaryContactFlag
FROM Person
LEFT OUTER JOIN Organization ON Person.PersonID = Organization.PrimaryContactID
Thank you