今天创建SQL server2005 程序集时,提示权限失败,我是sa权限。
最后通过 添加如下这句才得以通过
1: ALTER DATABASE [TestDB] SET TRUSTWORTHY ON
完整代码如下:
1: USE [TestDB]
2: GO
3: IF EXISTS (SELECT * FROM sys.assemblies asms WHERE asms.name = N'GetImage')
4: DROP ASSEMBLY [ImportMedia]
5:
6: ALTER DATABASE [TestDB] SET TRUSTWORTHY ON
7:
8: CREATE ASSEMBLY GetImageAssem
9: FROM 'C:\GetImage.dll'
10: WITH PERMISSION_SET = EXTERNAL_ACCESS;
11: GO
12:
13: CREATE PROCEDURE DownloadImage
14: (
15: @url nvarchar(200)
16: )
17: AS EXTERNAL NAME
18: GetImageAssem.[GetImage.Down].DownloadImage
19:
20: GO
21:
22: exec DownloadImage 'http://www.hedgate.net/wp-content/uploads/polaroid-chris.png'
本文转自敏捷的水博客园博客,原文链接http://www.cnblogs.com/cnblogsfans/archive/2009/05/14/1456942.html如需转载请自行联系原作者
王德水