Microsoft Extensibility SDK for C# for SQL Server

Tarale, Sandeep 0 Reputation points
2025-03-06T10:50:46.18+00:00

https://learn.microsoft.com/en-us/sql/language-extensions/tutorials/search-for-string-using-regular-expressions-in-c-sharp?view=sql-server-ver16

As mentioned in the above link carried out all the steps. However when I execute below command I am getting below error. Could you please help to resolve this issue.

==

error displayed is:

STDOUT message(s) from external script:

Failed to resolve full path of dotnet root [R:\Data\MSSQL15.MSSQLSERVER\MSSQL]

Error: Init failed: 0x0x80008085

Error: Get delegate failed: 0x0x80008081

Msg 39004, Level 16, State 20, Line 1

A 'dotnet' script error occurred during execution of 'sp_execute_external_script' with HRESULT 0x80004004.

STDOUT message(s) from external script:

Failed to resolve full path of dotnet root [R:\Data\MSSQL15.MSSQLSERVER\MSSQL]

Error: Init failed: 0x0x80008085

Error: Get delegate failed: 0x0x80008081

===

command executed in SQL server:

DECLARE @rowsCount INT;

DECLARE @regexExpr VARCHAR(200);

SET @regexExpr = N'[Cc]#';

EXEC sp_execute_external_script @language = N'dotnet',

@script = N'regex.dll;UserExecutor.CSharpRegexExecutor',

@input_data_1 = N'SELECT * FROM testdata',

@params = N'@regexExpr VARCHAR(200) OUTPUT, @rowsCount INT OUTPUT',

@regexExpr = @regexExpr OUTPUT,

@rowsCount = @rowsCount OUTPUT

WITH result sets((

        id INT,

        TEXT VARCHAR(100)

        ));

SELECT @rowsCount AS rowsCount, @regexExpr AS message;

===

C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
11,333 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Bruce (SqlWork.com) 72,026 Reputation points
    2025-03-06T20:32:45.7066667+00:00

    Is .net core installed on the Sqlserver and the same version used to create the dll?


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.