Friday, February 24, 2012

Create External_Access Assembly

Hello,

i really need urgently help with my deploying my assembly to my database!!
can somebody tell me how can i get the authorization to deploy my assembly
as permission_set = External_access or Unsafe?
i allways get error messages when i try to deploy my assembly that way.

i tried it with strong key and i tried it with asymmetric key like this:

use master
go

create asymmetric key WebServiceKey from executable file = '\...16082007.dll'

CREATE LOGIN WebServiceLogin FROM ASYMMETRIC KEY WebServiceKey

GRANT EXTERNAL ACCESS ASSEMBLY TO WebServiceLogin
GO

than i get the message:

The certificate, asymmetric key, or private key file does not exist or has invalid format.

thanks for every kind of help.

pamelia
If you can't get it to work using keys try this way:

1. From master, give the login of the owner of the database EXTERNAL ACCESS ASSEMBLY rights.
2. Alter the database your assembly livs ins and set trustworthy on:

Code Snippet

ALTER DATABASE your_db
SET TRUSTWORTHY ON



Niels
|||

Pamelia,

I would recommend downloading and installing the database engine samples from http://www.codeplex.com/MSFTEngProdSamples/Release/ProjectReleases.aspx?ReleaseId=4038 for SQL Server 2005 SP2 (or http://www.codeplex.com/MSFTEngProdSamples/Release/ProjectReleases.aspx?ReleaseId=5711 for the SQL Server 2008 July CTP) and then look at the Handling LOB Using CLR sample which is usually installed at systemdrive:\Program Files\Microsoft SQL Server\90\Samples\Engine\Programmability\CLR\HandlingLOBUsingCLR. The readme for this samples walks you step by step through the process of registering an external_access assembly. If you can't get this sample to work, then you've got some kind of permissions problem or you aren't signing the assembly correctly. If this sample works but your assembly doesn't then try to figure out the difference between how you got this sample to work and the way you are trying to get your own to work.

For security reasons it is better to use the key approach rather than using the TRUSTWORTHY bit.

--Bonnie

No comments:

Post a Comment