i have a query built in the Parameter@sql
and i Need the result in a variable
what i have:
Declare @Table varchar(50)
declare @Rowcount int
set @table = 'Persons'
set @sql = N'(select @Rowcount= count(*) as from ' + @Table + ')'
exec sp_executesql @sql,'@Rowcount int output', @Rowcount Output
i get the error
Die Prozedur erwartet den Parameter "@params" vom Typ "ntext/nchar/nvarchar".
the procedure expected a Parameter "@param" of type "ntext/nchar/nvarchar"