Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
jrockfl
Posting Yak Master
223 Posts |
Posted - 2005-06-14 : 06:52:43
|
| I have a query that takes at 50 seconds to run in EM, but only 4 in QA. What's the deal?I'm creating a VB.NET app and the query seems to take about 50 seconds to execute. If I was to turn that into a SProc, would I get speed like I did with QA? |
|
|
robvolk
Most Valuable Yak
15732 Posts |
Posted - 2005-06-14 : 07:23:19
|
| EM has overhead that QA does not. The overhead is what's taking so long. Don't use EM to write, run or test queries.Using a sproc is always a better choice. |
 |
|
|
DonAtWork
Master Smack Fu Yak Hacker
2167 Posts |
Posted - 2005-06-14 : 07:25:58
|
Don't lie rob. In-line SQL (especially table creates, inserts and deletes) rocks!/run and hide from the wrath of the rob *need more coffee*SELECT * FROM Users WHERE CLUE > 0(0 row(s) affected) |
 |
|
|
robvolk
Most Valuable Yak
15732 Posts |
Posted - 2005-06-14 : 07:26:56
|
ARRRRRGH!!!!You're killing me man! And you're wrong anyway, encrypted XML stored in a text column is DA SHIT! |
 |
|
|
jrockfl
Posting Yak Master
223 Posts |
Posted - 2005-06-14 : 07:57:03
|
| Thanks for the replies. I think I will write a SPROC and see if that helps. How much performance can a SPROC make? |
 |
|
|
robvolk
Most Valuable Yak
15732 Posts |
Posted - 2005-06-14 : 08:20:01
|
| The performance comes from having the execution plan cached. SQL Server can cache both stored procedures and parameterized SQL statements. Read Books Online under "sp_executesql" for some more background on it. And while a parameterized query can provide equivalent performance, stored procedures also better encapsulate the process and are easier to maintain in the long run. |
 |
|
|
|
|
|