Announcements
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 !
André Arnaud de Cal...
294,161
Super User 2025 Season 1
Martin Dráb
232,942
Most Valuable Professional
nmaenpaa
101,158
Moderator