1

Here's what I'm trying to accomplish - I have one server with say database A and database B. I want to set up a trigger on Database A to watch for table creation. Upon a table creation, I want to take parts of the data (table schema should be identical every time) of the created table and place it into a specific table on Database B.

I've been trying to do some research on this, I initially started digging into elastic querying to possibly get the job done, but I'm starting to think this approach may not work, as it appears elastic querying is read-only. Is there a similar approach I could use with t-sql or is there an approach I'm possibly not coming up with?

1 Answer 1

1

If table A has a TIMESTAMP / ROWVERSION column, or you can add to that table a column like that, then you can use an Azure Logic App to create that trigger. The Logic App has a SQL connector that uses a polling mechanism to query a table for changes using the TIMESTAMP / ROWVERSION column. This data type is specifically designed for this kind of processing in SQL. The polling query essentially selects all rows where the rowversion is greater than the last polled value. The behavior is reliable since the column is controlled by SQL Server and the performance is extremely fast in the case where there is no new data. When there is new data, the performance is comparable to a simple row query.

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

Comments

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.