Is there any other way of writing this query ?
SQL Server 2008 R2
LEFT OUTER LOOP JOIN PART_LIST p1 ON e.COLUMN3 = p1.CODE
AND p1.LIST_TYPE = 'PART_TEST_TYPE'
AND p1.LANGUAGE = 'en-US'
LEFT OUTER LOOP JOIN PART_LIST p2 ON e.SOURCE1 = p2.CODE
AND p2.LIST_TYPE = 'SOURCE_TYPE'
AND p2.LANGUAGE = 'en-US'
LEFT OUTER LOOP JOIN PART_LIST p3 ON e.SOURCE2 = p3.CODE
AND p3.LIST_TYPE = 'SOURCE_TYPE'
AND p3.LANGUAGE = 'en-US'
LEFT OUTER LOOP JOIN PART_LIST p4 ON e.STATUS = p4.CODE
AND p4.LIST_TYPE = 'PART_STATUS'
AND p4.LANGUAGE = 'en-US'
Yes. And EAV's aren't necessarily the "horrible problem" that many make them out to be. I just can't advise you because I don't know what the rest of the query does because you've left it out.
is pronounced ree-bar and is a Modenism for R
First step towards the paradigm shift of writing Set Based code: Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column.
Although they tell us that they want it real bad, our primary goal is to ensure that we dont actually give it to them that way.
Although change is inevitable, change for the better is not.
Just because you can do something in PowerShell, doesnt mean you should. Helpful Links:
How to post code problemsHow to post performance problemsForum FAQs