- How many fields have been specified?
SELECT Count (*) from information_schema.columns
Where Table_name = 'Tablename'
- Get all user table names
Select Object_name (ID)
From sysobjects
WHERE Xtype = 'u' and ObjectProperty (ID, 'ismshipped') = 0
- Get all index names on the specified table
Select Name from sysindexes
Where id = Object_id ('EMPBAS') and Indid> 0
Database information
EXEC (sp_databases)