您好我尝试使用 CLR 集成从 sql server 访问外部 exe。
我设置了我的数据库TRUSTWORTHY ON
,PERMISSION_SET = EXTERNAL_ACCESS
但出现以下错误
Msg 6522, Level 16, State 1, Procedure hello, Line 0
A .NET Framework error occurred during execution of user defined routine or aggregate 'hello':
System.Security.SecurityException: Request failed.
System.Security.SecurityException:
at HelloWorldProc.HelloWorld()
helloworld.cs 代码:
using System;
using System.Data;
using Microsoft.SqlServer.Server;
using System.Data.SqlTypes;
using System.Diagnostics;
public class HelloWorldProc
{
[Microsoft.SqlServer.Server.SqlProcedure]
public static void HelloWorld()
{
SqlContext.Pipe.Send("Hello world!\n");
Process.Start(@"D:\Raja\trg.exe");
}
}