zoukankan      html  css  js  c++  java
  • 获取存储过程的名称和信息

    SELECT sp.object_id AS FUNCTION_ID,
    	   sp.name AS FUNCTION_NAME,
           b.name + '.' + sp.name AS SFUNCTION_NAME,
    	   b.name AS SCHEMA_NAME,
           ISNULL(param.name, '') AS PARAM_NAME,
           ISNULL(usrt.name, '') AS [DATA_TYPE],
           sp.type AS TYPE,
           ISNULL(baset.name, '') AS [SYSTEM_TYPE],
           CAST(CASE
                    WHEN baset.name IS NULL THEN
                        0
                    WHEN baset.name IN ( 'nchar', 'nvarchar' )
                         AND param.max_length <> -1 THEN
                        param.max_length / 2
                    ELSE
                        param.max_length
                END AS INT) AS [LENGTH],
           '' AS PARAM_REAMRK,
           ISNULL(parameter_id, 0) AS SORT_ID
    FROM sys.objects AS sp
        INNER JOIN sys.schemas b
            ON sp.schema_id = b.schema_id
        LEFT OUTER JOIN sys.all_parameters AS param
            ON param.object_id = sp.object_id
        LEFT OUTER JOIN sys.types AS usrt
            ON usrt.user_type_id = param.user_type_id
        LEFT OUTER JOIN sys.types AS baset
            ON (
                   baset.user_type_id = param.system_type_id
                   AND baset.user_type_id = baset.system_type_id
               )
               OR
               (
                   (baset.system_type_id = param.system_type_id)
                   AND (baset.user_type_id = param.user_type_id)
                   AND (baset.is_user_defined = 0)
                   AND (baset.is_assembly_type = 1)
               )
        LEFT OUTER JOIN sys.extended_properties E
            ON sp.object_id = E.major_id
    WHERE sp.type IN ( 'FN', 'IF', 'TF', 'P' )
          AND ISNULL(sp.is_ms_shipped, 0) = 0
          AND ISNULL(E.name, '') <> 'microsoft_database_tools_support'
    ORDER BY sp.type DESC,
             b.name + '.' + sp.name,
             param.parameter_id ASC;
    
    
  • 相关阅读:
    170110-学习MoveIt!
    12.29-ros-gazebo高级
    12.27-ros-gazebo基础
    4.9-Simulation in gazebo or webots
    6.28-机器人模拟器Gazebo基础
    4.8-URDF in ROS
    Win32双缓冲画图原理
    Win32 计时器
    最简化的DirectX 11开发环境的配置 VS2010
    VS2010 C++编译报错LINK : fatal error LNK1123: 转换到 COFF 期间失败: 文件无效或损坏
  • 原文地址:https://www.cnblogs.com/baiqian/p/13324203.html
Copyright © 2011-2022 走看看