insert with dblink

Experts, good afternoon:

I need your support with a downside I have to insert user data on another server database, I have configured my link server correctly and I am creating a stored procedure to insert into multiple tables but only when inserted in the table users (tab_usuario) I get the error that can display image to the other tables I have no error.

I was doing my research and among them found it can be for any restriction of the target table (tab_usuario) but I do not find any problem with constrains or keys, can also be by the pull of transactions but when I do it for another insert in a separate table no problem
image.png
tab-usuario.sql
usp-ps-EqMovilesWeb.sql
enrique_aeoAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Docteur_ZCommented:
Hi,
For what I understand, if you use SET XACT_ABORT ON, it rolls back transaction in case of error, than you don't have to roll back manually. As it entcounter an error, your insert is rollbacked, and when it comes to the error management part of the code, it cannot issue the rollback command.
Do what you have to do in cas of roll back, but commen/remove the "rollback tran" command.
0
enrique_aeoAuthor Commented:
Comment "rollback tran", now the error is different.
Attached the error and the portion of code that causes the error
Error-Script.sql
image.png
0
Docteur_ZCommented:
What are the versions of the 2 different instances ?
See
https://msdn.microsoft.com/en-us/library/bb326310%28v=sql.110%29.aspx

and http://www.sqlbadpractices.com/linked-servers-and-distributed-queries/
You'll need MSDTC on the linked server host.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SQL Server

From novice to tech pro — start learning today.