web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Connect to CRM database through cmd or Powershell

(0) ShareShare
ReportReport
Posted on by

Hey,

My eventual goal is to automatically import data in an entity I have created in CRM.

I read that Microsoft Dynamics has a Microsoft SQL server edition running, which makes sense because there are entities in it.

(read it here: https://technet.microsoft.com/en-us/library/hh699671.aspx#sql_server_editions)

All I need is to connect to that SQL server through CLI, I have a username, password (Sysadmin role) and the URL which I use to go to the crm platform in my webbrowser. I am trying to establish this connection through cmd, powershell could also be an option but cmd is preffered. What I need to insert I have already converted into sql statements.

I Think that once establish this connection I can run sql code. Am I wrong somewhere?

Screenshot_5F00_17.png

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Nick.Doelman Profile Picture
    1,947 Most Valuable Professional on at

    First off, it is unsupported to directly insert data via SQL to CRM records.

    Essentially, Dynamics CRM platform needs to apply business rules to ensure the data is in a proper format and to maintain integrity of the data.

    Weird stuff will happen on the CRM side and Microsoft support is not obligated to help.

    The proper and supported way is to insert data into CRM via the platform (API) to ensure the data is added correctly.  The Dynamics CRM SDK outlines information on this.

    If you still want to use a "SQL" approach, I suggest you look a SQL Server Integration Services and I would highly recommend looking at the tools provided by Kingswaysoft http://www.kingswaysoft.com/  as they have connectors that will allow you import data into CRM using supported methods (so you don't have to write your own).  The have a free developer version.  There are other tools out there as well.

    If you are comfortable with Powershell, there are a set of commandlets that will allow you to manipulate data in CRM (also in a supported fashion), not sure if using this for bulk imports is the best way... but I don't fully know your requirement.

    https://msdn.microsoft.com/en-us/library/dn833081(v=crm.7).aspx

    Hope this helps!

    Cheers

    Nick

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.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
AS-17030037-0 Profile Picture

AS-17030037-0 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans