Write a T-SQL script that returns a list of indexes on the table called "Transactions",…
- User
Write a T-SQL script that returns a list of indexes on the table called "Transactions", including the index name, whether the index is clustered, the primary key, has a filter, and all the columns involved in the index.
Assistant
Here is a T-SQL script that returns the requested index information for the Transactions table:
sqlSELECT i.name AS IndexName, i.type_desc AS IndexType, i.is_primary_key AS IsPrimaryKey, i.has_filter AS HasFilter, col.name AS ColumnName FROM sys.indexes i INNER JOIN sys.index_columns ic ON i.object_id = ic.object_id AND i.index_id = ic.index_id INNER JOIN sys.columns col ON ic.object_id = col.object_id AND ic.column_id = col.column_id WHERE i.object_id = OBJECT_ID('Transactions') ORDER BY IndexName, ic.index_column_id
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.