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 |
|
mobUL
Starting Member
2 Posts |
Posted - 2004-07-09 : 10:23:08
|
I have a really simple problem but I am unable to see the solutionI have a Stored procedure (GetExamResults) that calls another Sproc (GetTests), thing is I need to store the number of records returned by the GetTests sproc in the variable @RecountCount. When I run the GetExamResults I get1Test0why isn't @RecordCount equal to 1 CREATE PROCEDURE [dbo].[GetExamResults]@ApplicantID int,@RecordCount int OUTPUT AS--Run the SprocExec GetTests @ID = @ApplicantIDSet @RecordCount = (@@RowCount)Print @@RowCountPrint 'Test'Print @QualCountGO |
|
|
ditch
Master Smack Fu Yak Hacker
1466 Posts |
Posted - 2004-07-09 : 10:30:36
|
| @@RowCount is Zero after the execution of a sp.If you want the rowcount of the result set of the sp you must return it in an output parameter from the spDuane. |
 |
|
|
mobUL
Starting Member
2 Posts |
Posted - 2004-07-09 : 10:35:16
|
| Many thanks |
 |
|
|
|
|
|