declare @ReCount int
declare @sql nvarchar(4000)
set @sql=N' select '+@RecordCount+' =isnull(count(*),0) as abc from tb_User as a '+ @str+' '
exec sp_executesql @sql,N'@RecordCount int output',@ReCount int output
declare @ReCount int
declare @sql nvarchar(4000)
set @sql=N' select '+@RecordCount+' =isnull(count(*),0) as abc from tb_User as a '+ @str
exec sp_executesql @sql,N'@RecordCount int output',@ReCount output