From: jreategui on
I'm trying to execute this:

create table #tt (nro_parte_erp varchar(50))
declare @query as varchar(4000)
declare @estado as char
set @estado='1'
set @query ='
select
nro_parte_erp= nro_parte

from openquery(desarrollo_baan,''
select
nro_parte,
from BAAN.ORDENES_102 a,baan.set_of_cim_102 b where
a.orden_fab_1=b.orden_fab and estado_orden='+@estado+''') a

order by orden_fab_1,operacion'

insert into #tt
exec (@query)


where desarrollo_baan is a linked server to oracle
but i receive this error:

No se puede realizar la operación. El proveedor OLE DB 'MSDAORA' no
pudo iniciar una transacción distribuida.
Traza de error de OLE DB [OLE/DB Provider 'MSDAORA'
ITransactionJoin::JoinTransaction returned 0x8000d048].

in english something like
The operation could not be performed because the OLE DB provider
'OraOLEDB.Oracle' was unable to begin a distributed transaction.
Error Trace of OLE DB [OLE/DB Provider 'MSDAORA'
ITransactionJoin::JoinTransaction returned 0x8000d048].


And i'm sure that MSDTC is running and i tried re-creating my server.


Some body can help me????

From: bluefish on
Can you run a simple select statement via link server?

"jreategui(a)gmail.com" wrote:

> I'm trying to execute this:
>
> create table #tt (nro_parte_erp varchar(50))
> declare @query as varchar(4000)
> declare @estado as char
> set @estado='1'
> set @query ='
> select
> nro_parte_erp= nro_parte
>
> from openquery(desarrollo_baan,''
> select
> nro_parte,
> from BAAN.ORDENES_102 a,baan.set_of_cim_102 b where
> a.orden_fab_1=b.orden_fab and estado_orden='+@estado+''') a
>
> order by orden_fab_1,operacion'
>
> insert into #tt
> exec (@query)
>
>
> where desarrollo_baan is a linked server to oracle
> but i receive this error:
>
> No se puede realizar la operación. El proveedor OLE DB 'MSDAORA' no
> pudo iniciar una transacción distribuida.
> Traza de error de OLE DB [OLE/DB Provider 'MSDAORA'
> ITransactionJoin::JoinTransaction returned 0x8000d048].
>
> in english something like
> The operation could not be performed because the OLE DB provider
> 'OraOLEDB.Oracle' was unable to begin a distributed transaction.
> Error Trace of OLE DB [OLE/DB Provider 'MSDAORA'
> ITransactionJoin::JoinTransaction returned 0x8000d048].
>
>
> And i'm sure that MSDTC is running and i tried re-creating my server.
>
>
> Some body can help me????
>
>
From: jreategui on
Yes, i tested the same code without the insert statment and it's run.

I mean, this code run perfect:
create table #tt (nro_parte_erp varchar(50))
declare @query as varchar(4000)
declare @estado as char
set @estado='1'
set @query ='
select
nro_parte_erp= nro_parte


from openquery(desarrollo_baan,''
select
nro_parte,
from BAAN.ORDENES_102 a,baan.set_of_cim_102 b where
a.orden_fab_1=b.orden_fab and estado_orden='+@estado+''') a


order by orden_fab_1,operacion'


/*insert into #tt */
exec (@query)

From: bluefish on
Looks like your problem is not with the link Server, b/c it is letting you
execute the command. Is the output less than varchar(50)? I have noticed that
sometimes when you use different software the output from exec(@SQL) will not
get into the temp table. Try insert into a temp table and see if that works?




"jreategui(a)gmail.com" wrote:
insert statment and it's run.
>
> I mean, this code run perfect:
> Yes, i tested the same code without the
> create table #tt (nro_parte_erp varchar(50))
> declare @query as varchar(4000)
> declare @estado as char
> set @estado='1'
> set @query ='
> select
> nro_parte_erp= nro_parte
>
>
> from openquery(desarrollo_baan,''
> select
> nro_parte,
> from BAAN.ORDENES_102 a,baan.set_of_cim_102 b where
> a.orden_fab_1=b.orden_fab and estado_orden='+@estado+''') a
>
>
> order by orden_fab_1,operacion'
>
>
> /*insert into #tt */
> exec (@query)
>
>
From: jreategui on
That's correct, the problem is not the linked server, the query run
perfect. The really problem is making the insert in the temp table with
the data that return the query to the linked server.

I tried making some manuals insert to the temp table and that work, but
with the linked server don't