create proc proc_Test @recordCount int out as begin declare nvarchare(max) @sqlText='select @rows=count(*) from TableName' exec sp_executesql @sqlText,N'@rows int output',@recordCount out end
create proc proc_Test @recordCount int out as begin declare nvarchare(max) @sqlText='select @rows=count(*) from TableName' exec sp_executesql @sqlText,N'@rows int output',@recordCount out end