Hola Daniel:

Algo asi estaba intentando armar, pero no se me ocurria como recuperar el
OUTPUT... Asi que Gracias lo pruebo y les Cuento..!!

Hola Maxi: Todo bien ..!!! Gracias,... Vos...?!?!
Te cuento...Tengo el Sinonimo y cuento con una tabla parametros dentro de la
base que me guarda los Servers, bases y sinonimos con los que la base
necesita hacer conexion remota...Y una dato mas.. trabajo con SQL2005 :D

Gracias a vos tambien..!!


El día 15/09/07, Daniel Aisenberg <[EMAIL PROTECTED]> escribió:
>
>  No se si funcionará con server remoto pero debería – usa sql dinámico:
>
>
>
>
>
> create procedure dbo.Proc1 @p1 int output
>
> as
>
> begin
>
>
>
> declare @strSql varchar(100)
>
>       , @b int
>
>
>
> -- Voy a llamar con exec al sp, pero guardaré los valores recibidos por
> parámetros output, en una tabla temporal
>
> -- Estimo que el nombre del sp podría apuntar a cualquier server y base de
> datos.
>
> if object_id( 'tempdb.dbo.#pars' ) is not null drop table #pars
>
> create table #pars( p2 int )
>
> set @strSql = 'declare @b int;
>
>                exec dbo.Proc2 @b output;
>
>                insert into #pars select @b;'
>
> exec ( @strSql )
>
> --set @p1=10;
>
> --set @[EMAIL PROTECTED]
>
> set @p1=( select p2 from #pars )
>
>
>
> -- libero la tabla temporal
>
> if object_id( 'tempdb.dbo.#pars' ) is not null drop table #pars
>
>
>
> end
>
>
>
> go
>
>
>
> -- Este sería tu procedimiento remoto
>
> create procedure dbo.Proc2 @p2 int output
>
> as
>
> begin
>
>
>
>   set @p2=20;
>
>
>
> end
>
>
>
> go
>
>
>
>
>
> declare @a int
>
> exec dbo.Proc1 @a output
>
> print @a
>
> go
>
>
>
>
>
> -----Mensaje original-----
> *De:* [email protected] [mailto:[EMAIL PROTECTED] *En nombre de *Claudia
> Almeda
> *Enviado el:* Viernes, 14 de Septiembre de 2007 11:02 a.m.
> *Para:* Daniel Aisenberg
> *Asunto:* [dbms] OUTPUT
>
>
>
> Hola lista,
>
> tengo una consulta para hacerles, a ver si alguien trabajo con algo
> similar...
>
>
>
>
>
> Tengo un StoredProcedure (SP1) que ejecuta un StoredProcedure (SP2) que se
> encuentra en otro servidor y otra base, el SP2 tiene dos parametros OUTPUT
> que necesito desde el SP1,
>
>
>
> La pregunta es: sin harcodear el nombre del Servidor y el de la Base, como
> puedo hacer  para recuperar los datos que me devuelve el SP2???
>
>
>
>
>
> para darles un poco mas de info, esto es lo que tengo dentro del SP1 hoy
> por hoy...
>
> SI SE LES OCURRE ALGO SE LOS VOY A AGRADECER.... a pesar de que me parecio
> algo sencillo, se me complico :(
>
>
>
> ServerRemote.BaseRemote.DBO.SP_BUSCO  ' DATOS ', 0, @PAR_1 OUTPUT,@PAR_2
> OUTPUT
>
>
> --
> Atte Almeda Claudia
>
>
>
> No virus found in this incoming message.
> Checked by AVG Free Edition.
> Version: 7.5.487 / Virus Database: 269.13.18/1007 - Release Date:
> 13/09/2007 09:48 p.m.
>



-- 
Atte Almeda Claudia

Responder a