zoukankan      html  css  js  c++  java
  • SQLserver、MySQL、ORCAL查询数据库、表、表中字段以及字段类型

    一、SQLServer命令

           1、查询SQLServer中的每个数据库

    SELECT * from sysdatabases
    

             

           2、查询SQLServer中指定数据库的所有表名         

      select name from CFS.. sysobjects where  xtype='u'   #注意:CFS 是数据库名称
    

     

    3、查询表中的字段以及字段类型

     select COLUMN_name as name,data_type as type
     from INFORMATION_SCHEMA.COLUMNS
     where table_name = '表名'
    

      二、MySQL命令

         1、查询MySQL中的每个数据库   

    show DATABASES
    

     

           2、查询MySQL中指定数据库的所有表名       

    select table_name as name
     from information_schema.tables
    where table_schema = '数据库名' and table_type = 'base table'
    

     

           3、查询表中的字段以及字段类型

    select COLUMN_NAME as name,DATA_TYPE as type from information_schema.columns where table_schema='表名'
    

    、ORCAL命令

         1、查询ORCAL中的每个数据库

         select * from v$tablespace
    

     

          2、查询ORCAL中指定数据库的所有表名       

    select * from user_tables;
    

     

         3、查询表中的字段以及字段类型

    select column_name from user_tab_columns where table_name = 'table_name';--表名要全大写
    

    参考网址1: https://www.cnblogs.com/lonelyxmas/p/10577287.html

    参考网址2: https://www.jb51.net/article/136787.htm

  • 相关阅读:
    sqlserver查询表字段
    Lombok
    属性配置
    计时器与启动加载器
    banner
    互斥锁和条件变量
    System V消息队列
    命令行参数的处理函数getopt
    posix 消息队列
    不定参数
  • 原文地址:https://www.cnblogs.com/my1227/p/11760023.html
Copyright © 2011-2022 走看看