Tag Archives: copy company

Create Same Company in another Database

When you create a company in your CRM database and at the same time looking to create the same company in another CRM database, then you can do this by defining below trigger for your source database: CREATE TRIGGER trig_insert_CompanyON [CRMSOURCEDB].[dbo].[Company]FOR INSERTAS DECLARE @Company_Id AS INTEXEC @Company_Id = [CRMDESTDB].dbo.eware_get_identity_id ‘Company’ INSERT [CRMDESTDB].dbo.Company (comp_companyid,comp_name,comp_type)SELECT @Company_Id,comp_name,comp_typeFROM inserted