Collections:
sys.indexes - Viewing Existing Indexes on an Given Table in SQL Server
How To View Existing Indexes on an Given Table using sys.indexes in SQL Server?
✍: FYIcenter.com
Another way to view existing indexes defined for a given table is to use the system view called "sys.indexes". The tutorial exercise shows you how many indexes were defined from the previous tutorial on table "fyi_links":
USE FyiCenterData; GO SELECT * FROM sys.indexes WHERE object_id = ( SELECT object_id FROM sys.tables WHERE name = 'fyi_links' ); GO object_id name index_id type_desc is_unique --------- ------------- -------- ---------- --------- 421576540 NULL 0 HEAP 0 421576540 fyi_links_id 2 NONCLUSTERED 0 421576540 fyi_links_url 3 NONCLUSTERED 0
The extra line in the query result is not a real index at this moment. It will be explained in another tutorial.
⇒ DROP INDEX - Removing Existing Indexes in SQL Server
⇐ SP_HELP - Viewing Existing Indexes on an Given Table in SQL Server
2016-11-15, 2023🔥, 0💬
Popular Posts:
How To Generate CREATE TABLE Script on an Existing Table in SQL Server? If you want to know how an e...
What is SQL Server Transact-SQL (T-SQL)? SQL Server Transact-SQL, also called T-SQL, is an extension...
How To Generate Random Numbers with the RAND() Function in SQL Server Transact-SQL? Random numbers a...
How To Create a Table Index in Oracle? If you have a table with a lots of rows, and you know that on...
What To Do If the StartDB.bat Failed to Start the XE Instance in Oracle? If StartDB.bat failed to st...