好像在查询分析器里面可以直接右键选择表点击编辑脚本就可以获得存储过程
是不是可以直接用SQL 语句来获取存储过程呢?

解决方案 »

  1.   

    from sys.objects
    where type='p' --this
      

  2.   

    你的理解有误,如果你所言的“表”即“存储过程”,参考如下获取其内容:
    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
      

  3.   

    以下代码列出了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                                
      

  4.   


    sys.all_objects,这个,在Sql Server 2k下叫怎么
      

  5.   

    select 列请您自己加。
      

  6.   

    系统表sysobjects 存储数据库内的每个对象(约束、默认值、日志、规则、存储过程等)的基本信息
    这里只是基本信息,不是存储过程的详细内容,还是在企业管理器或查询分析器选择后手工生成脚本吧
      

  7.   

    --sql2000中自己定义的存贮过程基本信息(不包含存贮过程的详细内容)
    select * from sysobjects
    where type='p' and category=0--sql2000中系统存贮过程
    select * from sysobjects
    where type='p' and category=2--都达不到楼主的要求