Link to home
Start Free TrialLog in
Avatar of Blowfelt82
Blowfelt82

asked on

Error creating assembly.

I am trying to create an assembly within Microsoft SQL Management Studio, unfortunately I do not have much experience with this and am a bit lost.

I have two databases setup, one of which works when I setup the assembly, so I assume that the server setup and permissions etc are OK in order to setup assemblies. Unfortunately on the other database I am getting the following error...

Msg 10327, Level 14, State 1, Line 2
CREATE ASSEMBLY for assembly 'TimeZones' failed because assembly 'TimeZones' is not authorized for PERMISSION_SET = UNSAFE.  The assembly is authorized when either of the following is true: the database owner (DBO) has UNSAFE ASSEMBLY permission and the database has the TRUSTWORTHY database property on; or the assembly is signed with a certificate or an asymmetric key that has a corresponding login with UNSAFE ASSEMBLY permission.
Msg 15151, Level 16, State 1, Line 2
Cannot alter the assembly 'TimeZones', because it does not exist or you do not have permission.
Msg 15151, Level 16, State 1, Line 2
Cannot alter the assembly 'TimeZones', because it does not exist or you do not have permission.
Msg 15151, Level 16, State 1, Line 2
Cannot alter the assembly 'TimeZones', because it does not exist or you do not have permission.
Msg 15151, Level 16, State 1, Line 2
Cannot alter the assembly 'TimeZones', because it does not exist or you do not have permission.
Msg 15096, Level 16, State 11, Procedure sp_addextendedproperty, Line 38
Could not find object 'TimeZones' or you do not have required permission or the object is not valid for adding extended property.
Msg 15096, Level 16, State 11, Procedure sp_addextendedproperty, Line 38
Could not find object 'TimeZones' or you do not have required permission or the object is not valid for adding extended property.

I have set trustworthy on, I have enabled CLR on my machine, I have set the database owner with UNSAFE ASSEMBLIES permission, but none of this seems to work... Does anyone have any trouble shooting ideas on this as I am stuck...

First person to get the script to run gets the points.

Thanks in advance.
ASKER CERTIFIED SOLUTION
Avatar of Daniel Wilson
Daniel Wilson
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Blowfelt82
Blowfelt82

ASKER

Thanks for the help,

I figured this out yesterday evening, the problem was due to the owner of the database being corrupt (I think) I recreated the user and everything started working.
OK, glad you solved it.  Thanks for posting the solution as it may help someone else ... and now I know one more thing to try should I encounter the problem or another person who has it.