我为 sql server 2005 编写了一个 CLR 方法并试图通过它运行一个 exe。
这是代码:
[Microsoft.SqlServer.Server.SqlFunction]
public static SqlString Function1()
{
System.Diagnostics.Process.Start("notepad.exe");
return new SqlString("Some string ");
}
部署后,当我尝试在 sql server 2005 中运行此 CLR 方法时,它给了我以下错误:
Msg 6522, Level 16, State 2, Line 1
A .NET Framework error occurred during execution of user defined routine or aggregate 'Function1':
System.Security.SecurityException: Request failed.
System.Security.SecurityException:
at UserDefinedFunctions.Function1()
是否可以运行这样的exe?