Stored procedure versus LINQ
-
I have a sql database which contains the core information I need to display for my users. I also have a couple of columns of information on an AS400 that I would like to perform a join on. I'm not too familiar with LINQ or stored procedures yet, and I would like to see what you guys would recommend using. There are quite a few records in these tables so performance is key. Thanks!
"You're damned if you do, and you're damned if you dont" - Bart Simpson
-
I have a sql database which contains the core information I need to display for my users. I also have a couple of columns of information on an AS400 that I would like to perform a join on. I'm not too familiar with LINQ or stored procedures yet, and I would like to see what you guys would recommend using. There are quite a few records in these tables so performance is key. Thanks!
"You're damned if you do, and you're damned if you dont" - Bart Simpson
itmaster21 wrote:
I'm not too familiar with LINQ or stored procedures yet
I would suggest doing some research in that case. Stored procedures are database functions while Linq can be anything from Linq to Objects to Linq to SQL to Linq to Active Directory and many more flavors
only two letters away from being an asset
-
itmaster21 wrote:
I'm not too familiar with LINQ or stored procedures yet
I would suggest doing some research in that case. Stored procedures are database functions while Linq can be anything from Linq to Objects to Linq to SQL to Linq to Active Directory and many more flavors
only two letters away from being an asset
Hi Mark, Sorry, when I originally wrote the post I wasn't thinking as clearly as I should have been. I'm familiar enough with both functions to understand what they do, but not enough to be able to sit down and write the code without doing a good bit of research first. To that extent, I figured I should find out which one would be more efficient for my situation before spending a lot of time going down the wrong road. The better question would be considering I have two seperate databases, would it be wiser to write a stored procedure that connects to the DB2 and joins the tables onto the SQL and simply returns the results to the C# code, or better to access both the SQL and DB2 directly from the C# code and process using Linq after I get the full result sets? I'm leaning more toward the stored procedure because to me it seems more efficient to eliminate the un-needed results before ever passing it back to my program, but I'm not sure if that's the case or not. Thanks!
Knowledge is not power, however, the acquisition and appropriate application of knowledge can make you a very powerful individual.
-
Hi Mark, Sorry, when I originally wrote the post I wasn't thinking as clearly as I should have been. I'm familiar enough with both functions to understand what they do, but not enough to be able to sit down and write the code without doing a good bit of research first. To that extent, I figured I should find out which one would be more efficient for my situation before spending a lot of time going down the wrong road. The better question would be considering I have two seperate databases, would it be wiser to write a stored procedure that connects to the DB2 and joins the tables onto the SQL and simply returns the results to the C# code, or better to access both the SQL and DB2 directly from the C# code and process using Linq after I get the full result sets? I'm leaning more toward the stored procedure because to me it seems more efficient to eliminate the un-needed results before ever passing it back to my program, but I'm not sure if that's the case or not. Thanks!
Knowledge is not power, however, the acquisition and appropriate application of knowledge can make you a very powerful individual.
Of course either way would work. Its a question of which is better for scalability and maintainability as well as performance. The stored proc does filter the results before sending them out but a well designed data layer wouldn't send extra data to the next layer either.
only two letters away from being an asset
-
Hi Mark, Sorry, when I originally wrote the post I wasn't thinking as clearly as I should have been. I'm familiar enough with both functions to understand what they do, but not enough to be able to sit down and write the code without doing a good bit of research first. To that extent, I figured I should find out which one would be more efficient for my situation before spending a lot of time going down the wrong road. The better question would be considering I have two seperate databases, would it be wiser to write a stored procedure that connects to the DB2 and joins the tables onto the SQL and simply returns the results to the C# code, or better to access both the SQL and DB2 directly from the C# code and process using Linq after I get the full result sets? I'm leaning more toward the stored procedure because to me it seems more efficient to eliminate the un-needed results before ever passing it back to my program, but I'm not sure if that's the case or not. Thanks!
Knowledge is not power, however, the acquisition and appropriate application of knowledge can make you a very powerful individual.
We've a AS400 system where I work. Finding the correct "flavour" of the AS400/DB2 dlls to support the entity framework from IBM was unecessarily complicated for us. Eventually we had to get ALL versions sent to us and one poor soul in our department had to pick through the documentation to find which version we needed. It took him a week. Full time. That said, now we have it, it seems to work fine. Have a look at the website, try and find the correct flavour for your rig & you'll see what I mean