資源描述:
《觸電事故應(yīng)急救援預(yù)案》由會員上傳分享,免費在線閱讀,更多相關(guān)內(nèi)容在行業(yè)資料-天天文庫。
1、16384)and((p.uid=u.uid)or(p.uid=m.groupuidandu.uid=m.memberuid))andp.protecttype<>206/*onlygrantrows*/andp.actionin(26,193,195,196,197)ando.uid<>u.uid/*norowsforowner*/andnotexists(/*excluderevoke'dprivileges*/select*fromsysprotectsp1wherep1.protecttype=206and
2、p1.action=p.actionandp1.id=p.idandp1.uid=u.uid)unionselect/*Addrowsfortableowner*/convert(sysname,db_name())TABLE_QUALIFIER,convert(sysname,user_name(o.uid))TABLE_OWNER,convert(sysname,object_name(o.id))TABLE_NAME,convert(sysname,user_name(u.uid))GRANTOR,conve
3、rt(sysname,user_name(o.uid))GRANTEE,convert(varchar(32),casev.numberwhen193then'SELECT'when195then'INSERT'when196then'DELETE'when197then'UPDATE'else'REFERENCES'end)PRIVILEGE,convert(varchar(3),'YES')IS_GRANTABLEfromsysobjectso,master.dbo.spt_valuesv,sysusersuw
4、hereobject_name(o.id)like@table_nameando.typein('U','V','S')anduser_name(o.uid)like@table_ownerandu.uid=1/*grantoris'dbo'ofdatabase*/andv.type=N'P'/*crossproducttogetallexposedprivileges*/andv.numberin(26,193,195,196,197)andnotexists(/*excluderevoke'dprivilege
5、s*/select*fromsysprotectsp1wherep1.protecttype=206andp1.action=v.numberandp1.id=o.idandp1.uid=o.uid)orderby2,3,6,5gograntexecuteonsp_table_privilegestopublicgodumptranmasterwithno_loggoprint'creatingsp_tables'go/*Procedurefor6.50andearlierservers*/createproced
6、uresp_tables(@table_namevarchar(96)=null,@table_ownervarchar(96)=null,@table_qualifiervarchar(32)=null,@table_typevarchar(100)=null)asdeclare@type1varchar(3)declare@tableindexint/*Specialfeature#1:enumeratedatabaseswhenownerandnameareblankbutqualifierisexplici
7、tly'%'.*/if@table_qualifier='%'and@table_owner=''and@table_name=''begin/*Ifenumeratingdatabases*/selectTABLE_QUALIFIER=convert(varchar(32),d.name),TABLE_OWNER=convert(varchar(32),null),TABLE_NAME=convert(varchar(32),null),TABLE_TYPE=convert(varchar(32),null),R
8、EMARKS=convert(varchar(254),null)/*RemarksareNULL*/frommaster.dbo.sysdatabasesdwhered.name<>'model'/*eliminateMODELdatabase*/orderby1end/*Specialfeature#2:enumerateownerswhenqualif