摘要:当我们把 Community Server 2.0 的数据库安装到 SQL 2005 数据库的时候,会收到很多如下的错误提示:
Cannot grant, deny, or revoke permissions to sa, dbo, information_schema, sys, or yourself.
我们察看其中的安装 SQL 脚本,是如下的 SQL 导致错误发生的:declare @command nvarchar(4000)
set @command = 'grant execute on [dbo].aspnet_RegisterSchemaVersion to ' + QUOTENAME(user)
exec (@command)
这行代码,看逻辑,应该是 自己把权限分配给自己。这么写在 sql 2000 下没有问题,在 sql 2005 下就出错了。不过一般这个错误可以忽略不计。因为不影响我们其他的逻辑。
另外,如果你在运行基于 sql 2005 数据库的 Community Server 2.0 站点,运行时候如果发现有些存储过程由执行权限的错误报告,可以执行如下sql脚本修复这个已知的BUG。 据说这个 BUG 要在 Community Server 2.1 中才修复。grant execute on dbo.cs_BlogActivityReportAggregate_Get to public
grant execute on dbo.cs_UserActivityReportRecords_Get to public
grant execute on dbo.cs_Content_GetList to public
grant execute on dbo.cs_PostAttachment_Delete to public
grant execute on dbo.files_Entries_GetEntries to public
grant execute on dbo.cs_PostAttachment_ToggleTemporary to public
grant......[
阅读全文]