zoukankan      html  css  js  c++  java
  • 获取存储过程的参数

    --获取表的基本信息Owner
    select
    [TableName]=[Tables].name,[TableOwner]=[Schemas].name
    from sys.tables as [Tables]
    inner join sys.schemas as [Schemas]
    on [Tables].schema_id=[Schemas].schema_id
    where [Tables].name='TableName'

    --根据表名获取字段列表
    select
    [ColumnName]=[Columns].name,
    [SystemTypeName]=[Types].name,
    [Precision]=[Columns].precision,
    [Scale]=[Columns].scale,
    [MaxLength]=[Columns].max_length,
    [IsNullable]=[Columns].is_nullable,
    [IsRowGUIDCol]=[Columns].is_rowguidcol,
    [IsIdentity]=[Columns].is_identity,
    [IsComputed]=[Columns].is_computed,
    [IsXmlDocument]=[Columns].is_xml_document,
    [Description]=[Properties].value
    from sys.tables as [Tables]
    inner join sys.columns as [Columns]
    on [Tables].object_id=[Columns].object_id
    inner join sys.types as [Types]
    on [Columns].system_type_id=[Types].system_type_id and is_user_defined=0 and [Types].name<>'sysname'
    left outer join sys.extended_properties as [Properties]
    on [Properties].major_id=[Tables].object_id and [Properties].minor_id=[Columns].column_id and [Properties].name='MS_Description'
    where [Tables].name='" + sTableName + "' order by [Columns].column_id

    --获取存储过程参数
    select
    [ProceduresName]=[Procedures].name,[Owner]=[Schemas].name
    from sys.procedures as [Procedures]
    inner join sys.schemas as [Schemas]
    on [Procedures].schema_id=[Schemas].schema_id
    where [Procedures].name='" + ProdecureName + "'"

  • 相关阅读:
    Winform架构
    SQL2008多数据库查询表或删表
    hdu1114 PiggyBank
    hdu2844 Coins
    hdu2602 Bone Collector
    hdu2191 珍惜现在
    hdu1203 I NEED A OFFER!
    求推荐
    TransparentBlt
    双缓冲加载位图 WinCE
  • 原文地址:https://www.cnblogs.com/jcgh/p/1969189.html
Copyright © 2011-2022 走看看