debido a que el execute se ejecuta en otro contexto diferente al sp que lo está llamando... no puedes compartir ni regresar variables....
para eso tendrias que hacer una tabla temporal y grabar ahi el valor obtenido desde el execute y luego en el sp obtener ese valor.
con tu ejemplo quedaria mas o menos asi...
Código:
DECLARE @vSQL varchar(1000), @posi int, @valor int
If Object_ID ('tempdb..#tmpValor') is not null
Drop table #tmpValor
create table #tmpValor (valor int)
Execute ('Insert into #tmpValor(valor) Select count(*) from ' + @Tabla )
If (Select count(*) from #tmpValor)> 0
Begin
Select Top 1 @valor = valor from #tmpValor
Set @posi = @nDias % @valor
Execute ('SELECT TOP 1 tope.* FROM (SELECT TOP ' + CONVERT(varchar,@posi) + ' * FROM ' + @tabla + ' ORDER BY id) AS tope ORDER BY id DESC')
End
If Object_ID ('tempdb..#tmpValor') is not null
Drop table #tmpValor