How to update ms sql database after insert data on mysql database? - mysql

I have a database on mysql (request from applestore) and now I must rewrite one table to ms sql. It's easy to rewrtie old rows, but when new row appear on mysql I need get this to ms sql table, and I don't know how to connect this and do it. Someone can hel me?

Why don't you try with triggers??..you need to create a trigger which insert the same data in a table when it is inserted in another table.

Related

Get logs of all update queries within database in mysql

I am looking to get all the update statements with old and new values within a database into one table.
For an example :
I have database name "users".
It contains four tables "primary_info","address_info","avtars","audit_logs"
Now, Whichever update statements executes on primary_info,address_info and avtars table that i need to log into audit logs table with below way.
ID, Table Name, Field_name,Old_value,New_value,Current Datetime
I know we can create triggers to manage such things.But i have database which contains more than 90 tables.So it won't help me to achieve by making trigger (update before) .
So is there any other way which i missed here ?
Thanks in advance.

SQL insert statement in teradata assistant

can anybody help me with this please?
I want to insert data in table in Teradata SQL Assistant, but insert only that doesn't exist in the table.
I have an ideal how to do it in Microsoft SQL Server but not in teradata as i'm new to it.
Any help would be highly appreciated.
Thank you
This very much depends on your situation. Can you elaborate a little more by answering the following questions? I can then give you my best idea of what to do.
Are you inserting into an existing table using a select statement from other Teradata tables, or from a file?
Does the table you are inserting into have a UPI (unique primary index)? You can check this by running the following code:
show table database.table;
where "table" is the name of your table and "database" is the database where your table is stored.
The end of the resultset should say either "unique primary index" or simply "primary index."
No matter what the answers are, you will most likely need to use an insert statement, insert-select statement, or a merge statement in the end. Teradata SQL Assistant has an example of all of these in the Query Builder. You can bring it up by pressing F2.
If I understood your question, You want to insert some data to a table. A the issue is you only need to insert those rows in the table for-example table A, which does not exist is this table A. The solution depends on your source.
If source is another Teradata table that is table B, then you could use a join between Table A and Table B so detect which are not already there.
If source is some other database or a file, than I would suggest to insert data to a temporary table and then use the same logic as given in point-1.
Br,
Hassam

MS Access "after insert" to replicate data accross different tables

I have 2 Identical tables and I want any data recorded in the first table to be automatically recorded in the 2nd table using data macros. Can anyone provide me with help on how to go about it?
After update, EXECUTE an INSERT INTO sql statement to the second table

Is it possible to update a table in MySQL from a trigger in SQL?

Is it possible to connect MS SQL to MySQL database?
I want to write a trigger after insert in SQL and update a table in mysql. I have tried to use sp_addlinkedserver, but I was not successful.

Inserted, Deleted Tables (Magic Tables) in MySQL

I am regular user of MS-SQL but now working on a project which has mysql as a back-end.
Please tell me that is there exists such a inserted/Deleted tables (Magic tables) in mysql which I can use inside trigger or in normal queries.
They are called NEW and OLD in MySQL.
NEW is the new record to be inserted or the updated data.
OLD is the deleted record, or the old data before an update.
See the documentation for creating a trigger here: http://dev.mysql.com/doc/refman/5.0/en/create-trigger.html