[Tips]:SQL server 2005 Create Assembly Failed
2009-05-14 16:45 敏捷的水 阅读(770) 评论(0) 编辑 收藏 举报今天创建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
版权:本文版权归作者所有,转载需经作者同意。
出处:http://www.cnblogs.com/cnblogsfans
版权:本文版权归作者所有,转载需经作者同意。