zoukankan      html  css  js  c++  java
  • SQL查询所有表,所有列

    1.查询实例中所有数据库

    select name,database_id from sys.databases

    2.查询数据库中所有表
    select TABLE_TYPE,TABLE_NAME from information_schema.tables order by TABLE_NAME

    select * from sysobjects where type='U' order by name(所有表)
    select * from sysobjects where type='SQ' order by name
    select * from sysobjects where type='FN' order by name
    select * from sysobjects where type='S' order by name
    select * from sysobjects where type='D' order by name
    select * from sysobjects where type='IT' order by name
    select * from sysobjects where type='F' order by name
    select * from sysobjects where type='F' order by name
    select * from sysobjects where type='PK' order by name(所有主键)
    select * from sysobjects where type='P' order by name
    select * from sysobjects where type='TF' order by name
    select * from sysobjects where type='C' order by name
    select * from sysobjects where type='UQ' order by name
    select * from sysobjects where type='V' order by name(所有视图)

  • 相关阅读:
    1-4-04:奇偶ASCII值判断
    1-4-03:奇偶数判断
    1-4-02:输出绝对值
    1-4-01:判断数正负
    1-3-20:计算2的幂
    1-3-19:A*B问题
    1-3-18:计算三角形面积
    Use PIVOT Table in SQL Server
    Pivoting DataTable Simplified
    Pivot Methods 行列转换
  • 原文地址:https://www.cnblogs.com/sunbingqiang/p/6237871.html
Copyright © 2011-2022 走看看