[sql]代码库
SELECT udf.NAME,
SCHEMA_NAME(udf.schema_id),
m.DEFINITION
FROM [sys].[all_sql_modules] m
INNER JOIN [sys].[all_objects] udf ON m.object_id = udf.object_id
WHERE DEFINITION LIKE '%create function%'
AND udf.type IN (
'TF',
'FN',
'IF',
'FS',
'FT'
)
AND CAST(CASE
WHEN udf.is_ms_shipped = 1
THEN 1
WHEN (
SELECT major_id
FROM sys.extended_properties
WHERE major_id = udf.object_id
AND minor_id = 0
AND class = 1
AND NAME = N'microsoft_database_tools_support'
) IS NOT NULL
THEN 1
ELSE 0
END AS BIT) = 0
by: 发表于:2017-09-07 15:52:28 顶(0) | 踩(0) 回复
??
回复评论