Listare assembly-uri pe baza de date

Configurare noua (How To)

Situatie

Mai jos aveti o procedura ce returneaza assembly-urile de pe baza pe care este rulata si tipul de permisiune pe fiecare assembly

Solutie

create procedure BD_ListareAsmb_prc

as

SELECT
so.[Name], so.[type], SCHEMA_NAME(so.SCHEMA_ID) AS [Schema],
asmbly.[Name], asmbly.permission_set_desc, am.assembly_class,
am.assembly_method

FROM [sys].assembly_modules am
INNER JOIN [sys].assemblies asmbly ON asmbly.assembly_id = am.assembly_id
INNER JOIN [sys].objects so ON so.OBJECT_ID = am.OBJECT_ID

UNION

SELECT
at.[Name], ‘TYPE’ AS [type], SCHEMA_NAME(at.SCHEMA_ID) AS [Schema],
asm.[Name], asm.permission_set_desc, at.assembly_class,
NULL AS [assembly_method]
FROM [sys].assembly_types at
INNER JOIN [sys].assemblies asm ON asm.assembly_id = at.assembly_id

ORDER BY 4, 2

Tip solutie

Permanent

Voteaza

(10 din 17 persoane apreciaza acest articol)

Despre Autor

Leave A Comment?