I'm trying to create an "unsafe assembly":
USE master
GO
CREATE ASYMMETRIC KEY StoredProcedures_dll_Key
FROM EXECUTABLE FILE = 'C:\Documents and Settings\All Users\Documents\hunter\StoredProcedures.dll';
CREATE LOGIN StoredProcedures_dll_Login
FROM ASYMMETRIC KEY StoredProcedures_dll_Key;
GRANT EXTERNAL ACCESS ASSEMBLY TO StoredProcedures_dll_Login;
GO
USE gfx_sa
GO
CREATE ASSEMBLY hunter_storedProcedures
FROM 'C:\Documents and Settings\All Users\Documents\hunter\StoredProcedures.dll'
WITH PERMISSION_SET = UNSAFE;
GO
CREATE PROCEDURE [dbo].[hunter_storedProcedure1]
(
@.symbol_id as int
)
AS EXTERNAL
NAME hunter_storedProcedures.StoredProcedures.StoredProcedure1
GO
But on 'CREATE ASSEMBLY" clause I'm getting error:
Msg 0, Level 11, State 0, Line 0
A severe error occurred on the current command. The results, if any, should be discarded.
Msg 0, Level 20, State 0, Line 0
A severe error occurred on the current command. The results, if any, should be discarded.
Assembly is signed by Visual Studio.
What's wrong?
Best regards...
This is caused by the same problem as explained in KB 918040: http://support.microsoft.com/default.aspx/kb/918040
The same workaround will solve your problem: EXEC sp_changedbowner ‘sa’ (or any other login that you know exists on the server).
If you upgrade to the latest service pack, then you should get the error message listed in the KB rather than the 'A severe error occurred...' message.
Steven
No comments:
Post a Comment