How do I display index information for the SQL Server table?

zhaozj2021-02-16  120

SQLSTR = "SELECT index name = a.name, table name = c.Name, index field name = D.Name," "sort = case indexkey_property (Object_ID ('" this.tablename ", A.indID, B. Keyno, 'Isdescending') " " WHEN 1 TEN 'Descendment' When 0 TEN 'Skation' End " " from sysindexes a " " join sysindexkeys b on A.Id = B.ID and A.indid = B .indid " " join sysobjects c on b. ID = C.ID " " JOIN SYSCOLUMNS D on B.ID = D.ID and b.colid = D.COLID " " Where A.indid Not in (0,255) " " And c.XTYPE = 'u' and c.status> 0 and c.name = '" this.tablename "' and a.name not like '_wa_sys%' " " Order by C.Name, A .name, d.name;

The indexkey_property is an ascending order or descending of an index.

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

New Post(0)