title: MSSQL Try Catch and Set Identity Insert in MySQL?
body: <p>Do you know how to rewrite these this query in MySQL ?
  I can't find Identity insert, I can't find any try catch, 
  I don't understand it.</p>
  
  <pre><code>CREATE TRIGGER T1 ON DB1.dbo.A
  AFTER INSERT AS
  
   BEGIN TRY
  
    SET IDENTITY_INSERT DB2.dbo.B ON
     INSERT INTO dbo.B(id, text) SELECT A.id,A.text FROM dbo.A INNER JOIN inserted I ON I.id = A.id
    SET IDENTITY_INSERT DB2.dbo.B OFF
  
    SET IDENTITY_INSERT DB2.dbo.D ON      
     INSERT INTO dbo.D(id, text) SELECT A.id,A.text FROM dbo.A INNER JOIN inserted I ON I.id = A.id     
    SET IDENTITY_INSERT DB2.dbo.D OFF
  
   END TRY
   BEGIN CATCH
  
    ROLLBACK TRANSACTION
  
    SET IDENTITY_INSERT DB2.dbo.B OFF
    SET IDENTITY_INSERT DB2.dbo.D OFF
   END CATCH
  
  GO
  </code></pre>