Search
 
SCRIPT & CODE EXAMPLE
 

SQL

check index sql server

create procedure _ListIndexes(@tableName nvarchar(200))
as
begin
/*
exec _ListIndexes '<YOUR TABLE NAME>'
*/
SELECT DB_NAME(DB_ID()) as DBName,SCH.name + '.' + TBL.name AS TableName,IDX.name as IndexName, IDX.type_desc AS IndexType,COL.Name as ColumnName,IC.*
    FROM sys.tables AS TBL 
         INNER JOIN sys.schemas AS SCH ON TBL.schema_id = SCH.schema_id 
         INNER JOIN sys.indexes AS IDX ON TBL.object_id = IDX.object_id 
         INNER JOIN sys.index_columns IC ON  IDX.object_id = IC.object_id and IDX.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 TBL.name = @tableName
    ORDER BY TableName,IDX.name

end
Comment

PREVIOUS NEXT
Code Example
Sql :: add colum date in sql 
Sql :: sqlite save db 
Sql :: how to enable extension in postgreSQL 
Sql :: create or replace function 
Sql :: getdate function in postgresql 
Sql :: how to inner join 4 tables in sql 
Sql :: mysql select default if null 
Sql :: How to pass password to mysql command line 
Sql :: sql running total 
Sql :: sql all 
Sql :: sql server insert into table 
Sql :: mysql backup database command line 
Sql :: postgresql not case sensitive where in 
Sql :: postgresql get connection string 
Sql :: mysql remove first and last character from string 
Sql :: PostgreSQL types and C# types 
Sql :: declare varchar sql server 
Sql :: postgres update with if condition query 
Sql :: sql server phone constraint 
Sql :: postgresql filter on 
Sql :: groupby error in mysql 
Sql :: importing excel data into sql server 
Sql :: setting default value for Boolean data type in SQL 
Sql :: mysql wont stop 
Sql :: subquery in sql 
Sql :: find all tables with column name 
Sql :: mysql loop 
Sql :: oracle select row max date 
Sql :: sql trim from string 
Sql :: Upgrading postgresql data from 13 to 14 failed! 
ADD CONTENT
Topic
Content
Source link
Name
4+9 =