Is .net core installed on the Sqlserver and the same version used to create the dll?
Microsoft Extensibility SDK for C# for SQL Server
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;
===