0
您好,我嘗試通過使用CLR集成訪問從SQL Server的外部EXE。System.Security.SecurityException:請求失敗
我把我的數據庫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");
}
}
它的工作正常。 –