2013-02-02 288 views
0

您好,我嘗試通過使用CLR集成訪問從SQL Server的外部EXE。System.Security.SecurityException:請求失敗

我把我的數據庫TRUSTWORTHY ONPERMISSION_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"); 
} 
} 

回答

0

我得到了這個錯誤,我們要設置的解決方案SQL Server服務以管理員登錄。

控制面板 - >管理工具 - >服務

找到MSSQLServer服務從本地系統更改其登錄作爲管理員。

現在我可以通過SQL Server過程打開Word文檔。

+0

它的工作正常。 –