DEFINITIONS

Definitions More Info.
Definition ID271
TitleSQL
CategorySCRIPT
DefinitionPermission Databases ServerNames Tables
Definition Description/* Null alan oldugunda database uzerinde tum o yetkiye sahip demektir.Object uzerinde yetki verildiginde zaten object adini gormekteyiz. */
SELECT @@SERVERNAME AS ServerName, DB_NAME() AS DatabaseName, ISNULL(sch.name, osch.name) AS SchemaName, ISNULL(o.name, '.') AS ObjectName, o.type_desc, dprin.NAME AS Grantee, grantor.name AS Grantor, dprin.type_desc AS principal_type_desc, dperm.permission_name, dperm.state_desc AS permission_state_desc
FROM sys.database_permissions dperm
INNER JOIN sys.database_principals dprin ON
dperm.grantee_principal_id = dprin.principal_id
INNER JOIN sys.database_principals grantor ON
dperm.grantor_principal_id = grantor.principal_id
LEFT OUTER JOIN sys.schemas sch ON
dperm.major_id = sch.schema_id
AND dperm.class = 3
LEFT OUTER JOIN sys.all_objects o ON
dperm.major_id = o.OBJECT_ID
AND dperm.class = 1
LEFT OUTER JOIN sys.schemas osch ON
o.schema_id = osch.schema_id
WHERE dprin.name <> 'public'
AND dperm.type <> 'CO'
AND dprin.type <> 'R'
--and dprin.NAME like '%eakyildiz%' ORDER BY 1, 2, 3, 4, 5
RecordBycunay
Record Date16-11-2012 16:20:12
Düzenle
Kopyala
Sil