Timeline for Join to get most specific record for tenant without PIVOT
Current License: CC BY-SA 4.0
9 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Oct 9, 2020 at 22:56 | history | edited | crichavin | CC BY-SA 4.0 |
added more detail
|
Oct 9, 2020 at 22:55 | vote | accept | crichavin | ||
Oct 9, 2020 at 22:48 | comment | added | crichavin | @AaronBertrand yes it is subjective. We have common repository classes so we can define these types of queries once and reuse them all over so we don't have the litter. SPs also require an additional element to keep in sync with the application code. They are also a lot more fixed in that they are a set query and result set vs dynamic queries in LINQ. It can be done, but its not as easily. On the performance front, EntityFramework creates really messy and poor performing queries sometimes...we have had great success in rolling our own in that case using indexed views and stored procedures. | |
Oct 9, 2020 at 21:30 | comment | added | Aaron Bertrand | That seems pretty subjective. Personally, I find stored procedures a lot easier to deal with for maintenance purposes than having queries littered throughout application code. YMMV. I also don't know of any scenario where taking a query from an application and stuffing it into a view will make anything more efficient aside from the reduction in bytes of network chatter. | |
Oct 9, 2020 at 21:22 | history | edited | crichavin | CC BY-SA 4.0 |
added more detail
|
Oct 9, 2020 at 21:17 | comment | added | crichavin | @AaronBertrand just preference. We prefer to limit views/sp's as much as possible for maintenance reasons unless it either can't be done, or the query is so inefficient that the only solution is a DB view or sp. | |
Oct 9, 2020 at 20:35 | answer | added | Mike Petri | timeline score: 1 | |
Oct 9, 2020 at 20:16 | comment | added | Aaron Bertrand | Why do you care if LINQ still doesn't understand what PIVOT means? If LINQ is just consuming the output, and can't handle syntax added in <checks memory> SQL Server 2008, use a stored procedure. LINQ understands those, right? Why limit yourself to a subset of syntax because LINQ is behind? | |
Oct 9, 2020 at 19:40 | history | asked | crichavin | CC BY-SA 4.0 |