List assembly on SQL Server

Configurare noua (How To)

Situatie

Mai jos este o procedura ce listeaza toate assembly-urile create pe un server Microsoft SQL.

Solutie

create procedure ListAssembly
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
JOIN [sys].assemblies asmbly ON  asmbly.assembly_id = am.assembly_id AND asmbly.[Name] NOT LIKE ‘Microsoft%’
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],
    asmbly.[Name], asmbly.permission_set_desc,
at.assembly_class,
    NULL AS [assembly_method]
FROM [sys].assembly_types at
JOIN [sys].assemblies asmbly ON  asmbly.assembly_id = at.assembly_id AND asmbly.[Name] NOT LIKE ‘Microsoft%’
ORDER BY 4, 2, 1;

Tip solutie

Permanent
Etichetare:

Voteaza

(11 din 25 persoane apreciaza acest articol)

Despre Autor

Leave A Comment?