2013-02-02 292 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

它的工作正常。 –