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 |
|
GaneshRamanan
Starting Member
40 Posts |
Posted - 2011-09-12 : 04:22:35
|
| Hi,Can anyone guide me, My Query getting Delayed for execution.I m calling SP1SP1 invokes function1Function1 returns the value depends on StudentId.When I indivdually runs the function, it has been immediately return the results.But in SP1, I have 3500 Students. By one by one I'm passing into function1 to get the result.Can anyone guide me... how to get the result ASAP? from SP1.I have checked in Profiler too..for improving performance but no recommendations has been suggested. Is there any other solution for this Issue.Thanks,Ganesh Ramanan |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2011-09-12 : 04:25:19
|
| is the function Function1 scalar valued or table valued?how are you calling? what is it doing actually?if definition is simple, you can think of implementing logic inline in your procedure without going for function.in any case, some more detail on what function is doing will help us to suggest more------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
GaneshRamanan
Starting Member
40 Posts |
Posted - 2011-09-12 : 05:04:59
|
| 1. Its Table Valued Function2. based on StudentId, function1 will return the studentid,joined date,grade..etc3.In SP1 from while loop I m invoking function1 by incrementing one by one StudentId.I m getting the output and inserting to into the Table. |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2011-09-12 : 05:26:00
|
| no need of all this if its table valued. sounds like what you need is a simple join operation in your procedure for retrieving the student details. no need of while loop also. you can use a set based select which gives you all the information. so you may dispense with table valued function altogether.------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
|
|
|