Smallfish

Tips, Tricks, Shticks & Anything That Can Help You Be better Developer

Browse by Tags

All Tags » SQL Server (RSS)
LINQ to SQL Performance loading Hierarchical data
Last week I have trying to load hierarchical data from the same table (Parent/Child). Although I have made it in the past, I was searching the way to accomplish it with LINQ to SQL without SP or at least with the minimum required (in any case, I had a "fallback"). After 4 hours of searching the net without success (there are plenty of articles, nothing met my requirements see here and here ). Then I thought to give LINQ a chance, and I just used it querying the association created by the...
The Dummy ‘DUMMY’ Table
A problem I have encountered today seems to be a kind of “magic”: A Single INSERT statement that was checked for uniqueness was inserting duplicate rows into the table for each insert. All other parties in the system (Client, Server, etc.) sent the data only once and could not be the problem. Investigating the SQL Statement behind this insert shows this query (data and structure were changed): INSERT INTO TableX (A, B, C) SELECT ‘X’ AS A, 2 AS B,’2008-11-19 ‘AS C FROM DUMMY WHERE NOT EXISTS (SELECT...