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 |
|
Vivaldi
Constraint Violating Yak Guru
298 Posts |
Posted - 2005-05-12 : 09:46:44
|
| I need some direction.I have a reasonably nasty stored procedure that creates a temp table, does a bunch of recursive calls (to put records into the temp table) and then if it finds nothing, does some additional things to find the right records for the temp table.the sproc then returns the temp table to the web page.I fiddled around, and did another version within a UDF without a temp table (using a table type). How can I figure out which is faster? I have done some reading, but is there a way to run each a few times and determine their running length easily?Thanks for any advice, pointers.________________________________________________Beer is a privilege of the working man.In the fridge: Edil Pils. |
|
|
Knarf180
Starting Member
42 Posts |
Posted - 2005-05-12 : 13:37:08
|
| If you have local access to the SQL server running the query you can load up Profile Monitor, which comes with MSSQL server. It will show you every query that hits the specified database, how many read and writes it took to complete the task, how much CPU usage was used and how long it took. Its really a nice tool.Otherwise, look into the "SET STATISTICS" command. It may provide some use.- Frank |
 |
|
|
X002548
Not Just a Number
15586 Posts |
Posted - 2005-05-12 : 13:41:54
|
| Lose the recursion?Is it too big to post?Brett8-) |
 |
|
|
Vivaldi
Constraint Violating Yak Guru
298 Posts |
Posted - 2005-05-12 : 13:45:17
|
quote: Originally posted by X002548 Lose the recursion?Is it too big to post?Brett8-)
I think so. The way the app needs to function just makes the db code pretty aweful. The design isn't bad, but its hard to replicate a tree type structure and add on heirarchial permissions for each "branch or leaf" and you have a mess.thanks though.________________________________________________Working man's privilege, beer is.Harsh, Life is. |
 |
|
|
|
|
|
|
|