I usually do not use Sql Server Management Studio, I usually use Linqpad to run all my db queries. Anyhow…. My boss seems to think that stored procs are ‘a lot faster than linq’.
So to test this, I want to run a simple stored proc and display the time it takes to run against an equal linq statement.
Any good ideas on how to achieve this? I am sure you guys (and gals) have run across this before.
Any ideas on how to compare that to the runtime of a linq statement?
EDIT: Let me clarify some things; First when my boss says ‘linq’ I can only assume she is talking about Linq-to-Sql. Second, I am willing to try every way possible to test out this theory.
Your boss is right in the sense that stored procedures are like compiled code whereas LINQ (which uses SQL) is more like interpreted code.
BUT… you lose flexibility with stored procs. Also, are you running them alot, as in over 10,000 times a minute? If not then you won’t really notice a difference.
Alot of things can influence query speed, the least of which is stored proc vs freeform query. I’d worry more about database structure and things like indexes before I’d worry about making everything stored procs.