Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Microsoft Dynamics 365 | Integration, Dataverse...
Unanswered

Query Tables Attributes Metadata via PowerShell

(0) ShareShare
ReportReport
Posted on by 45

This refers to Powershell query to Dynamics 365(Dataverse). I need to export metadata for 40 Dynamics 365/Dataverse tables(entities). For each table I have the list of columns to get metadata for : eg: account (account_col1, account_col2,..., account_col270). Each of the 40 tables can contain large number of columns/attributes, but I have the column list for each entity (not all columns of these entities are required). The metadata export should contain following columns :
tableName,
columnName(attribute)
DataType,
Max_Length,
Precision,
Scale,
is_nullable.

Datatype example can be INT, decimal, etc (for which precision and scale apply), or varchar, uniqueidentifier for which precision and scale are 0 but is captured Max_Length. This metadata export will help pre-create tables on the destination relational database where the actual data will be imported (data has been export separate). I can see this metadata columns in SSMS by join from sys.columns, sys.objects, but cannot do this dynamically.
to create this metadata export I plan on using PowerShell. Looking for a similar PS script where can input tablename and columnName and get the 7 metadata info that I listed above for each of the table columns pairs. I found https://www.powershellgallery.com/packages/Microsoft.Xrm.Data.Powershell/2.1/Content/Microsoft.Xrm.D... but was not able to find all export columns that I need (eg: userdatatype, precision, scale, is_nullable).

Can you help how I can get the 7 metadata columns as above for the Dataverse tables attributes? I would prefer in PowerShell.

Thank you !

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Jonas ”Jones” Melgaard – Community Spotlight

We are honored to recognize Jonas "Jones" Melgaard as our April 2025…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 294,161 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 232,942 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,158 Moderator

Leaderboard

Product updates

Dynamics 365 release plans