0

I have a local and an Azure database. When a row is inserted in the local db, I would like it to insert it in the Azure one. I have created a trigger on the local db for that task:

USE [db_local] 
Create trigger [dbo].[trigInverse] on [dbo].[db_local]
after insert
 as 
begin
  insert into [serverazure.DATABASE.WINDOWS.NET].[db_azure].[Access].[Companies]([CompanyName])
  select NAME
from inserted;
end 

However, when I try to insert a row the error in picture1 appears

enter image description here

I cannot see what the parameter is, and how to set a correct value in that error message.

I did some tests to find the cause: I put that trigger between 2 local db, and tried adding rows to the source db, and it works In the linked server node, these are the settings

enter image description here

1 Answer 1

2

You can use Azure SQL Data Sync, download and install in your local server SQL Azure Data Sync Agent

Then setup your azure data base like this:

Getting Started with Azure SQL Data Sync

It will sync your databases every 5 minutes.

Sign up to request clarification or add additional context in comments.

2 Comments

Thank you very much Wilson, I will try this. Can it sync only specific columns in the table?
Yes, you can. Here explain this: Step 3 - Configure sync group If it was useful please mark as answer. :D

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.