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.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 How to Improve Performance

Author  Topic 

GaneshRamanan
Starting Member

40 Posts

Posted - 2011-09-17 : 08:05:36
I m having 3500 EmpId in empmaster

SP1 Invokes the function1

Function1 calculates some values and return to SP1.

IN SP1 I used
while loop increment by 1 by 1 for getting empid and passing itto the function1.

Execution time for SP1 is too delayed to run, even for 10 Employees.

Am I using the right choice for fetching the empid.

can any one guide me to improve execution time for SP1.

Thanks,
Ganesh Ramanan

ehorn
Master Smack Fu Yak Hacker

1632 Posts

Posted - 2011-09-17 : 09:20:24
Hello,

Loops, in general, will not be as performant as set-based operations. If you could post some sample table structures and data and the desired output, someone can most likely help you restructure the procedure to a set-based operation.

HTH.
Go to Top of Page
   

- Advertisement -