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
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Dynamic Stored Procedures

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2001-09-05 : 23:50:28
Mani writes "I'm using a dynamic stored procedure to get the number of rows in the table like:

Create Procedure sp_GetCount @TableName varchar(255), @ReturnVal bigint OUTPUT As

Declare @SQL varchar(255)
@SQL = "SELECT COUNT(*) FROM " + @TableName

EXECUTE (@SQL)

GO

Now my dilemma is how do i return the count value?

I'm calling this procedure from another procedure and need this value in the output parameter."
   

- Advertisement -