Ad

Azure Sql - Cross Database Trigger

- 1 answer

I am migrating my database from sql server to Sql Azure. I have two databases in place which talk to each other using trigger. i.e If any record is inserted in Customer table of first database the trigger gets fired and record is inserted in another database.

I came to know that Sql Azure does not support such kind of cross database queries. Though by researching more i found a new feature called Elastic Query . Can any one tell me how to write Trigger that works between two database in Sql Azure ?

Ad

Answer

Don't.

Move the dependency in the application and have the application update both databases, as appropriate.

Doing what you're trying to do was a bad practice on-premise as well (think backups-restore and availability issue scenarios), but you could get away with it. Lucklily the Azure restrictions will force you to devise a better solution.

Ad
source: stackoverflow.com
Ad