Notifications
Announcements
No record found.
Hi guys,
I have a requirement where i need to retrieve data fro On-Premise SQL and insert in CRM online.
How i can achieve this, can anyone help me out in this?
Regards,
Gopinath V.
*This post is locked for comments
hi Gopi,
Which job need to do this operation? A plugin/workflow or a console app/service?
If you want this to be done via a plugin/workflow then you need to create a WCF service which exposes you data and then call it from plugin. This service will act as layer and will interact with DB while the plugin will interact with the service.
Thanks,
PS
Refer this:
crmbook.powerobjects.com/.../select-a-tool-to-use
Hi PS,
I want to use plugin but my CRM is in online how the plugin will try to connect to On-Premise SQL db, i don't think so that if anything let me know.
Thanks
Hi Akhtar,
The link which you provide is a tool whether this will connect my On-Premise db and move the data to CRM online.
Use SSIS .
blogs.msdn.microsoft.com/.../integrating-crm-using-sql-integration-services-ssis
Scribe can connect to On Premise DB and CRM Online as well
Hi Gopinath,
The plugin need to call the Azure hosted web service.
The Azure hosted web service will in turn call the local SQL Server.
You can read here for connecting Azure web app with local SQL DB.
docs.microsoft.com/.../web-sites-hybrid-connection-get-started
Hi gopi, I am affraid that you cant achieve that through plugin. I have tried to create plugin in crm online to connect CRM 365 Database. The problem is, you need to register your plugin in "None Isolation Mode". Unfortunately, this mode is not supported for CRM Online. Only "Sandbox" is supported. CMIIW .
I would suggest you to use Console Application to accomplish your work. Here is the code i use to connect into CRM Database from console application:
try { using (SqlConnection con = new SqlConnection("Data Source=10.10.123.123; Initial Catalog=MLPT_MSCRM;User Id=admin;Password=admin")) { string sqlQuery = @"SELECT [OpportunityId],[new_PresalesID] FROM [MLPT_MSCRM].[dbo].[Opportunity] where Createdon >= DATEADD(DAY, -1, getdate())"; using (SqlCommand cmd = new SqlCommand(sqlQuery, con)) { SqlDataAdapter da = new SqlDataAdapter(cmd); da.Fill(dt); } Console.WriteLine("Connection Success !!"); logger.Info("Connection Success !!"); } Console.WriteLine("Attempting to get records from Database"); logger.Info("Attempting to get records from Database"); if (dt.Rows.Count > 0) { for (int i = 0; i < dt.Rows.Count; i++) { try { presalesid = dt.Rows[i][1].ToString(); serviceid = new Guid(dt.Rows[i][0].ToString()); Console.WriteLine("Records Retrieved"); } } }
In my view you have a few options:
1. Use a tool like Scribe (online). They have agents that you can run locally and can connect from the cloud
2. Use a plugin. But then you need to have an azure webservice that somehow connects to your onpremises SQL DB (using an Azure Function would be a very lightweight option)
3. Use Microsoft flow (flow.microsoft.com/.../sql-server) in combination with the GateWay (flow.microsoft.com/.../gateway-manage) to connect to you local db.
Hi Martijn,
The option 3 i have used it and that can be used for sending records from CRM to SQL.
It's not from SQL to CRM, you can't retrieve records from SQL to CRM.
The option 2 for that we need to buy Azure and so that we can access the db right?
Gopi
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
SA-08121319-0 4
Calum MacFarlane 4
Alex Fun Wei Jie 2