Some SQL Server system information

xiaoxiao2021-03-06  65

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

转载请注明原文地址:https://www.9cbs.com/read-85813.html

New Post(0)