user11469175
user11469175

Reputation:

How can I connect to MS Dynamics 365 CRM with SSMS

I'm trying to connect to MS Dynamics 365 CRM with SQL Server Management Studio. After lots of researching I can't find any solution that how can I connect database.

Upvotes: 1

Views: 5447

Answers (3)

paras chauhan
paras chauhan

Reputation: 787

The first solution you should try is to enable CDS T-SQL Endpoint in the Power Platform Admin and use the endpoint in SSMS, because these are all from Microsoft (Dynamics, CDS T-SQL, SSMS). They will interact natively with each other. As an alternative, I also found the Skyvia SQL Endpoint that will give you a URL that you can use to connect your SSMS to Dynamics 365. The steps include:

  1. Create a Skyvia Dynamics 365 connection. You need to sign-in to Dynamics 365 to get the access token.

enter image description here

  1. Create a Skyvia SQL Endpoint and use the Dynamics 365 connection you made in #1. Setup the security config and assign a user and password. You will be given a URL that you can use in SSMS.

  2. Open SSMS and use the Skyvia SQL endpoint to connect. Then, perform SQL queries.

Upvotes: 0

jasonscript
jasonscript

Reputation: 6180

Depending on what you're trying to do with SQL, you can also use the SQL 4 CDS plugin for the XRM Toolbox

More information on the SQL 4 CDS plugin is available here

SQL 4 CDS allows you to use standard SQL syntax to query and manipulate your data and metadata in CDS / D365.

Supports

  • SELECT
  • INSERT
  • UPDATE
  • DELETE

Where possible the queries are converted to FetchXML, allowing you to generate FetchXML queries for plugins or integrations by writing familiar SQL and converting it.

Using the preview T-SQL endpoint, SELECT queries can also be run that aren't convertible to FetchXML.


EDIT I just realised that the author of this plugin is the same as the author of the article in the other answer

Upvotes: 1

marc_s
marc_s

Reputation: 755321

You can connect to Dynamics365 (at least when it's "in the cloud") using SSMS following this recipe here:

https://markcarrington.dev/2020/05/13/cds-t-sql-endpoint-pt-1-connecting/

Basically, you need to explicitly enable the TDS endpoint in the Power Platform admin area and then use yourcrm.crm.dynamics.com,5558 as the server/instance name, and some Azure Active Directory authentication scheme to connect.

Upvotes: 2

Related Questions