Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 INSERT INTO EXEC LINK SERVER

Author  Topic 

hl19521985
Starting Member

6 Posts

Posted - 2013-12-28 : 04:45:50

begin

set xact_abort ON
set nocount on;
declare @t2 as t2
begin distributed tran
--create table #t1 (a int);
insert into @t2
exec [LINK-212].[AdventureWorks].dbo.test
-- update [LINK-212].AdventureWorks.dbo.t1 set a=2

-- insert into [LINK-212].AdventureWorks.dbo.t1 values (1);


select * from @t2
commit tran


end






Error FOLLOW:

?????"LINK-212"? OLE DB ???? "SQLNCLI10" ????? "???????"?
?? 7391,?? 16,?? 2,? 8 ?
???????,??????? "LINK-212" ? OLE DB ???? "SQLNCLI10" ??????????

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2013-12-28 : 05:13:54
is test a procedure you created on linked server [LINK-212]?

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page

hl19521985
Starting Member

6 Posts

Posted - 2013-12-31 : 09:24:25
yes
Go to Top of Page

hl19521985
Starting Member

6 Posts

Posted - 2013-12-31 : 10:33:02
you can help me ?
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2013-12-31 : 13:07:34
First test if linked server is active.

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page

hl19521985
Starting Member

6 Posts

Posted - 2013-12-31 : 22:04:12
begin

set xact_abort ON
set nocount on;
declare @t2 as t2
begin distributed tran
--create table #t1 (a int);
exec [LINK-212].[AdventureWorks].dbo.test
-- update [LINK-212].AdventureWorks.dbo.t1 set a=2

-- insert into [LINK-212].AdventureWorks.dbo.t1 values (1);


select * from @t2
commit tran


end


this is ok
Go to Top of Page

hl19521985
Starting Member

6 Posts

Posted - 2013-12-31 : 22:05:27
begin
----this is error-----
set xact_abort ON
set nocount on;
declare @t2 as t2
begin distributed tran
--create table #t1 (a int);
insert into @t2
exec [LINK-212].[AdventureWorks].dbo.test
-- update [LINK-212].AdventureWorks.dbo.t1 set a=2

-- insert into [LINK-212].AdventureWorks.dbo.t1 values (1);


select * from @t2
commit tran


end

----this is error-----
Go to Top of Page

hl19521985
Starting Member

6 Posts

Posted - 2013-12-31 : 22:10:13
Does not support distributed development
------------- Thus the error. . . . . . .
insert into @ t2
exec [LINK-212]. [AdventureWorks]. dbo.test



Such implementation is normal --------
exec [LINK-212]. [AdventureWorks]. dbo.test
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2014-01-01 : 11:07:14
Do you've MSDTC (Microsoft Distributed Transaction Coordinator) service installed and running on the machine? Otherwise you wont be able to implement distributed transactions like above.
Go to start - > run type services.msc and see if you've Distributed Transaction Coordinator listed among installed services.

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page
   

- Advertisement -