SELECT * from Information_schema.columns WHERE table_name= ' account ' SELECT if A.colorder=1 then d.name Else ' E nd) as table name,--if the table name is the same, return the empty a.colorder as field ordinal, a.name as field name, (case when ColumnProperty (A.id,a.name, ' Isiden Tity ') =1 then ' √ ' Else ' End as identity, (case if (SELECT count (*) from sysobjects--query primary key WHERE ( Name in (the SELECT name from sysindexes WHERE (id = a.id) and ( Indid in (SELECT indid from Sysindexkeys WHE RE (id = a.id) and (Colid in (SELECT colid from syscolumns WHERE (id = a.id) and (name = A.name))))))))) and (xtype = ' PK ')) >0 Then ' √ ' else ' end ' as primary key,--query primary key end B.name as type, a.length as takes up bytes, columnproperty (a.id,a.name, ' PRECISION ') As length, IsNull (COLUMNProperty (A.id,a.name, ' scale '), 0) as decimal place (case time a.isnullable=1 then ' √ ' else ' end) as allows null, ISNULL (E.text, ") as Default value, IsNull (G.[value], ') as field description from syscolumns a LEFT join systypes B on a.xtype=b.xusertype inner join SYSOB Jects D on A.id=d.id and d.xtype= ' U ' and d.name<> ' dtproperties ' left joins syscomments E on a.cdefault=e.id Left joins Sys.extended_properties G on a.id=g.major_id and a.colid = g.minor_id ORDER by A.id,a.colorder querying all table names in the database and field name statement SQL query all table names: select name from SYSOBJECTS WHERE type= ' U ' SELECT * from INFORMATION_SCHEMA. Tables all field names of the query table: select name from syscolumns WHERE id=object_id (' Table name ') SELECT * from INFORMATION_SCHEMA. Tablesselect * from INFORMATION_SCHEMA. Viewsselect * from INFORMATION_SCHEMA. Columnsoracle View all table names: Select table_name from user_tablesaccess View all table names: select name from Msysobjects WHERE type=1 and Flags=0 Msysobjects is a system object, which is hidden by default. It can be displayed by tools, options, views, displays, system objects, and so on.
SQL Server queries database all fields-table name