Xrm.DataManager.Framework.Tds
2026.0.2
dotnet add package Xrm.DataManager.Framework.Tds --version 2026.0.2
NuGet\Install-Package Xrm.DataManager.Framework.Tds -Version 2026.0.2
<PackageReference Include="Xrm.DataManager.Framework.Tds" Version="2026.0.2" />
<PackageVersion Include="Xrm.DataManager.Framework.Tds" Version="2026.0.2" />
<PackageReference Include="Xrm.DataManager.Framework.Tds" />
paket add Xrm.DataManager.Framework.Tds --version 2026.0.2
#r "nuget: Xrm.DataManager.Framework.Tds, 2026.0.2"
#:package Xrm.DataManager.Framework.Tds@2026.0.2
#addin nuget:?package=Xrm.DataManager.Framework.Tds&version=2026.0.2
#tool nuget:?package=Xrm.DataManager.Framework.Tds&version=2026.0.2
Xrm.DataManager.Framework.Tds
Retrieve Microsoft Dataverse records with SQL (TDS endpoint) in Xrm.DataManager.Framework batch jobs.
SQL simplifies and speeds up data retrieval (joins, aggregates, filters on linked tables) : records are then processed by the framework (multi threading, retries, progress file, logging).
Getting started
Prerequisites
Enable TDS endpointsetting enabled on the Dataverse environment- Dataverse connection with Entra ID authentication (OAuth, ClientSecret or Certificate) : its access token is used for SQL connection
- Network access to TDS endpoint port (1433 or 5558)
Write a job
using Xrm.DataManager.Framework;
public class AnonymizeContactsJob : SqlFullProcessDataJobBase
{
public AnonymizeContactsJob(JobSettings jobSettings, JobProcessParameters parameters) : base(jobSettings, parameters) { }
public override string GetName() => "Anonymize contacts";
// contactid is added automatically when missing
public override string GetSqlQuery() => "SELECT TOP 1000 emailaddress1, createdby, createdbyname FROM contact WHERE emailaddress1 LIKE '%.com'";
public override void ProcessRecord(JobExecutionContext context)
{
var email = context.Record.GetSqlValue<string>("emailaddress1");
var creator = context.Record.GetSqlEntityReference("createdby", "systemuser");
// SQL columns are not in Attributes : only modified columns are sent
context.Record["emailaddress1"] = email.Replace(".com", ".fake");
context.Proxy.Update(context.Record);
}
}
Run it like any other job :
using (var processor = new JobProcessor())
{
processor.Execute<AnonymizeContactsJob>();
}
How records are built
- The query is parsed before execution : it must be a single
SELECTstatement. - Primary key column of the records table (first table of
FROMclause, orGetSqlEntityName()) is added if missing and used as record id. - Other columns are stored in
Record.FormattedValues(culture invariant strings) and read withGetSqlValue<T>(column)/GetSqlEntityReference(column, table):Attributesstay empty, so the record can be updated without sending SQL columns back. - Lookups and choices are returned as
{column}(id or value) and{column}name(label), dates are UTC.
Direct SQL access
TdsClient retrieves records or opens a SQL connection outside of SqlFullProcessDataJobBase (ex : in PreOperation, or on another connection) :
// Optional parameters : command timeout (seconds) and port
var tdsClient = new TdsClient(proxy, Logger);
var accounts = tdsClient.RetrieveRecords("SELECT name, accountnumber FROM account WHERE statecode = 0");
Settings
Used by SqlFullProcessDataJobBase :
Key (appSettings) |
Default | Description |
|---|---|---|
Tds.Port |
1433 | TDS endpoint port (1433 or 5558, depending on your firewall) |
Tds.CommandTimeout.Seconds |
300 | SQL query timeout |
Limits
- Read only : 5 minutes query timeout (2 minutes for
SELECT *and joins). - SQL queries don't trigger RetrieveMultiple plugins.
- Elastic tables aren't supported,
NOLOCKhint should be avoided.
Documentation
Feedback
Questions, bugs and suggestions : GitHub issues.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Framework | net48 is compatible. net481 was computed. |
-
.NETFramework 4.8
- Microsoft.Data.SqlClient (>= 7.1.1)
- Microsoft.SqlServer.TransactSql.ScriptDom (>= 180.140.0)
- System.Security.Cryptography.Pkcs (>= 10.0.14)
- Xrm.DataManager.Framework (>= 2026.0.2)
-
net10.0
- Microsoft.Data.SqlClient (>= 7.1.1)
- Microsoft.SqlServer.TransactSql.ScriptDom (>= 180.140.0)
- System.Security.Cryptography.Pkcs (>= 10.0.14)
- Xrm.DataManager.Framework (>= 2026.0.2)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.