I have a stored procedure called usp_getTotalOrder which looks like
Select * from Order where CompanyID = 1;
Now, I have a table which contains stored procedure names.
In my BLL I have a stored procedure name. I want to create function which contain one parameter StoredProcedureName and returns the count of total rows which is like
Declare @str varchar(50)
Set @str='GetOrders'; // Stored Procedure Name
Exec @str
But it does not return total row count that I want to get from the stored procedure with its name in the function.
Any IDEA???
Please help…..
Take a look at
@@ROWCOUNThttp://technet.microsoft.com/en-us/library/ms187316.aspx
You might be able to use something like: