CLR Permissions SQL SERVER 2008

windows-server-2008

We are running SQL SERVER 2008, I have a webpage that is executing a stored procedure. This stored procedures runs various updates to a several tables which have triggers. The error I am receiving when the web site runs is below

Error 6549, Level 16, State , Procedure trg_TAA_DFLRemoval,
Line1, message: A .NET framework error occurred during execution of user defined routine or aggregate 'trg_tAA_DFLRemoval':

which is followed by all the method calls.

I have tried

GRANT EXECUTE ON ASSEMBLY::[T2AuditTrigger] TO [NT AUTHORITY\NETWORK SERVICE]

But there seems to be a syntax error in my sql generated script. While searching I found that Microsoft decided not to allow GRANT EXECUTE to function. Is this an accurate statement in regards to my problem.

What I cant seem to find out is how to get the user permission to run the Assembly.

Best Answer

First, you'll want to grant the rights to the account that the web server is logging into the SQL Server as. Hopefully that isn't the NETWORK SERVICE account.

That error "A .NET framework error occurred during execution of user defined routine or aggregate 'trg_tAA_DFLRemoval':" is an error from the .NET framework, not from the SQL Server, so something is blowing up within the .NET method you are calling. What happens when you call the method manually from T/SQL?

Related Topic