SQL statement queries all tables in a database

Source: Internet
Author: User
--Read all table names in the library select name from sysobjects where xtype= ' u '-reads all column names of the specified table select name from syscolumns where id= (select Max (ID) fro M sysobjects where xtype= ' u ' and name= ' table name ') Get database table names and fields the role of the individual system tables in SQL Server sysaltfiles the primary database saves the file of the database syscharsets the primary database Character set and sort order sysconfigures primary database configuration options syscurconfigs Primary database current configuration option sysdatabases database in primary database server Syslanguages primary database language syslogins primary database Login account information sysoledbusers primary database link Server login information sysprocesses primary database process sysremotelogins master database telnet account syscolumns each database column sysconstrains each database Limit sysfilegroups per database file group sysfiles each database file Sysforeignkeys each database external keyword sysindexs each database index sysmenbers each database role member sysobjects each number According to library all database objects syspermissions per database permissions systypes per database user-defined data type Select column name =name from syscolumns where id=object_id (N ' table name to look up ')

SQL statement queries all tables in a database

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.