April 7, 2010 at 12:29 am
Hi
I have a stored procedure which calculates the leaves of employees.The only problem is i have to run the stored procedure more than once to make sure it has done the calculation for all the employees and then it gives me the correct results.
the first time i run the stored proc, it says that 360 rows were generated.The next time i run it says that 80 rows were generated. the next time i run it says that 5 rows were generated.
i wanted to know is there some SQL Setting which is limiting the number of rows being generated when a stored procedure runs.
Thanks
April 7, 2010 at 2:07 am
To have a chance of answering this we should see example data and the code. Have a look at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for guidance on providing these.
BrainDonor.
April 7, 2010 at 6:22 am
hmm thats quite interesting, or i would say some poor SQL logic ;-).
Post the Stored Proc's script
-------Bhuvnesh----------
I work only to learn Sql Server...though my company pays me for getting their stuff done;-)
April 8, 2010 at 6:24 am
Can you please give me the sample code and sp query which you have written.
April 8, 2010 at 11:28 pm
lijusmail (4/7/2010)
i wanted to know is there some SQL Setting which is limiting the number of rows being generated when a stored procedure runs.
SET ROWCOUNT can limit the number of rows being affected.
April 9, 2010 at 7:51 am
Without seeing code, who knows?
Here's a guess: If it's an OLTP database maybe new records are being added or modified in between runs of the sproc and that's why the count is differing.
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply