如何在SQL Server中查看功能的内容/说明
答案 0 :(得分:0)
sp_helptext N'objectName'
objectName可以是存储过程或函数名称
答案 1 :(得分:0)
答案 2 :(得分:0)
下面是一个示例,您可以按照此操作
USE AdventureWorks2012;
GO
-- Get the function name, definition, and relevant properties
SELECT sm.object_id,
OBJECT_NAME(sm.object_id) AS object_name,
o.type,
o.type_desc,
sm.definition,
sm.uses_ansi_nulls,
sm.uses_quoted_identifier,
sm.is_schema_bound,
sm.execute_as_principal_id
-- using the two system tables sys.sql_modules and sys.objects
FROM sys.sql_modules AS sm
JOIN sys.objects AS o ON sm.object_id = o.object_id
-- from the function 'dbo.ufnGetProductDealerPrice'
WHERE sm.object_id = OBJECT_ID('dbo.ufnGetProductDealerPrice')
ORDER BY o.type;
GO