CLR SP server param

  • Hi

    Im passing a value into a clr sp and that value is a printer on the network, I've tried doing a test print from the printer properties and prints fine, so when i execute the sp in sql server 2008 and use the value \\SR-BRZ-DC01\prn-brz-bmkt i get the error saying...

    A .NET Framework error occurred during execution of user-defined routine or aggregate "TFLabelPrinting":

    System.Exception: Msg Access is denied.

    Info

    Source SetPrinterName with name \\SR-BRZ-DC01\prn-brz-bmkt

    i get the exact same error when trying to call it from client, the weird thing is i have managed to get this printing before now it just wont print and the clr sp code hasnt changed. The printing method is a third party dll so im just calling it.

  • When you create the assembly for a CLR object you have to specify the PERMISSION_SET. If you don't specify it, the permissions given the assembly is SAFE. That means no external system resources can be addressed by the assembly.

    You probably want to change the PERMISSION_SET to UNSAFE in order to access a third-party. This isn't ideal, but I think in your situation it may be the solution.

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply