--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