Troubleshooting Guide: SQL Server Error 6573 – “Method ‘GetData’ Call Failure”
Why This Error Happens
Error 6573 in Microsoft SQL Server 2025 typically occurs when the CLR (Common Language Runtime) integration attempts to invoke a method on a SQLCLR object but encounters a security or assembly-trust violation. This is most often caused by the target assembly being marked as UNSAFE or EXTERNAL_ACCESS without the corresponding database or server-level trust configuration being properly set. It can also stem from a corrupted assembly reference in the sys.assemblies catalog or a mismatch between the .NET runtime version expected by the assembly and the one installed on Windows Server 2025.
Step-by-Step Resolution Guide
Step 1: Verify CLR Integration is Enabled
- Open SQL Server Management Studio (SSMS) and connect to the instance reporting Error 6573.
- Run the following query to check the current configuration:
sp_configure 'clr enabled';
- If the
run_valueis0, enable it using:
sp_configure 'clr enabled', 1;
RECONFIGURE;
Step 2: Validate Assembly Trust and Permission Set
- Query the
sys.assembliesandsys.assembly_modulessystem views to identify the specific assembly tied to the “GetData” method call:
SELECT name, permission_set_desc, is_user_defined
FROM sys.assemblies;
- If the
permission_set_descshowsUNSAFEorEXTERNAL_ACCESS, ensure the database hasTRUSTWORTHYset toONonly if necessary, or preferably useCREATE ASSEMBLYwith a trusted signature:
ALTER DATABASE [YourDatabaseName] SET TRUSTWORTHY ON;
- For SQL Server 2025 strict security mode, use the newer
sys.sp_add_trusted_assemblyprocedure with the correct SHA-512 hash instead of relying solely onTRUSTWORTHY.
Step 3: Re-register the Corrupted Assembly
- Drop and re-add the problematic assembly to clear any file-pointer corruption:
DROP ASSEMBLY [YourAssemblyName];
CREATE ASSEMBLY [YourAssemblyName]
FROM 'C:\Path\To\YourAssembly.dll'
WITH PERMISSION_SET = SAFE;
- Verify the file path is accessible to the SQL Server service account (check NTFS permissions in
Windows Server 2025File Explorer properties).
Step 4: Check .NET Runtime Compatibility
- Confirm that the required .NET Framework/Core runtime version matching the assembly’s target framework is installed on the host OS.
- Navigate to
Control Panel > Programs and Features(Windows 11/Server 2025) to confirm the installed runtime versions. - Restart the SQL Server (MSSQLSERVER) service via
services.mscafter any runtime updates.
Alternative or Verification Steps
- To verify the fix, execute the original stored procedure or query that triggered the “GetData” call; the Error 6573 message should no longer appear in the SQL Server Error Log (
SQL Server Management Studio > Management > SQL Server Logs). - If the error persists, as an alternative, isolate the issue by testing the assembly in a sandboxed
tempdbenvironment to rule out database-specific permission conflicts before redeploying to production.