在sql server 2000中,可以通過 exec master..sp_dropextendedproc 方法刪除系統擴充套件儲存過程。然而,到2005後,因為有些系統擴充套件儲存過程系統也要使用,因此,就不能刪除了,可以採用
deny execute on [系統擴充套件儲存過程名] to [角色]
的方法,將相關的系統儲存過程禁用。
以下是網上流傳的一些「危險」的儲存過程:
deny execute on xp_cmdshell to public
deny execute on xp_dirtree to public
deny execute on xp_fileexist to public
deny execute on xp_getnetname to public
deny execute on sp_oamethod to public
deny execute on sp_oacreate to public
deny execute on xp_regaddmultistring to public
deny execute on xp_regdeletekey to public
deny execute on xp_regdeletevalue to public
deny execute on xp_regenumkeys to public
deny execute on xp_regenumvalues to public
deny execute on xp_regread to public
deny execute on xp_regwrite to public
deny execute on xp_readwebtask to public
deny execute on xp_makewebtask to public
deny execute on xp_regremovemultistring to public
deny execute on sp_oacreate to public
deny execute on sp_addextendedproc to public
然後,我們可以通過下列的方法,檢視系統擴充套件儲存過程的禁用情況:
select dp.name as principal_name,
dp.type_desc as principal_type_desc,
o.name as object_name,
p.permission_name,
p.state_desc as permission_state_desc
from sys.database_permissions p
left outer join sys.all_objects o
on p.major_id = o.object_id
inner join sys.database_principals dp
on p.grantee_principal_id = dp.principal_id
and p.grantee_principal_id=database_principal_id('public')
SQL 2005 儲存過程分頁
create procedure dbo p pagetest sql nvarchar max sql語句不包括排序 curpage int,當前頁 pagerows int,頁面尺寸 order nvarchar 20 排序字段 ordertype nvarchar 10 排序型別倒序desc或...
SQL 2005 多表分頁儲存過程
region 返回所有職位物件 帶分頁 region 返回所有職位物件帶分頁 當前頁 每頁顯示數 返回 頁數 返回總項數 物件集合 public static listgetallmodel int curpage,int size,ref int pagesize,ref int totalsiz...
SQL2005 分頁儲存過程
最近在使用sqlserver2005的資料庫編碼,查到有乙個row number order by 字段 的函式,通過該函式進行分頁非常的方便,請大家看看我寫的分頁儲存過程。分頁儲存過程 create procedure dbo proc testpage 表名 tablename nvarchar...