你的理解有误,如果你所言的“表”即“存储过程”,参考如下获取其内容: SELECT OBJECT_NAME(sm.object_id) AS ob_name,o.type,o.type_desc,sm.definition FROM sys.sql_modules AS sm JOIN sys.objects AS o ON sm.object_id=o.object_id where o.type='p' --this
以下代码列出了SQL Server 2005中存在的所有储存过程。 USE [your_database_name_here]; GO SELECT * FROM sys.all_objects WHERE ([type] = 'P' OR [type] = 'X' OR [type] = 'PC') ORDER BY [name]; GO
--sql2000中自己定义的存贮过程基本信息(不包含存贮过程的详细内容) select * from sysobjects where type='p' and category=0--sql2000中系统存贮过程 select * from sysobjects where type='p' and category=2--都达不到楼主的要求
where type='p' --this
SELECT OBJECT_NAME(sm.object_id) AS ob_name,o.type,o.type_desc,sm.definition
FROM sys.sql_modules AS sm
JOIN sys.objects AS o ON sm.object_id=o.object_id
where o.type='p' --this
GO
SELECT * FROM sys.all_objects
WHERE ([type] = 'P' OR [type] = 'X' OR [type] = 'PC')
ORDER BY [name];
GO
sys.all_objects,这个,在Sql Server 2k下叫怎么
这里只是基本信息,不是存储过程的详细内容,还是在企业管理器或查询分析器选择后手工生成脚本吧
select * from sysobjects
where type='p' and category=0--sql2000中系统存贮过程
select * from sysobjects
where type='p' and category=2--都达不到楼主的要求