Home Microsoft SQL Server DigiMailing iRN Contact
    Keyword



sys.sp_indexes

  No additional text.


Syntax

create procedure sys.sp_indexes
(
    @table_server       sysname,
    @table_name         sysname = null,
    @table_schema       sysname = null,
    @table_catalog      sysname = null,
    @index_name         sysname = null,
    @is_unique          bit = null
)
as
    select
        TABLE_CAT           = TABLE_CATALOG,
        TABLE_SCHEM         = TABLE_SCHEMA,
        TABLE_NAME          = TABLE_NAME,
        NON_UNIQUE          = convert(smallint, 1 - [UNIQUE]),
        INDEX_QUALIFIER     = TABLE_NAME,
        INDEX_NAME          = INDEX_NAME,
        TYPE                = case [CLUSTERED]
                                when 1 then 1
                                else 3
                              end,
        ORDINAL_POSITION    = ORDINAL_POSITION,
        COLUMN_NAME         = COLUMN_NAME,
        ASC_OR_DESC         = case [COLLATION]
                                when 1 then 'A'
                                when 2 then 'D'
                                else null
                              end,
        CARDINALITY         = CARDINALITY,
        PAGES               = case [CLUSTERED]
                                when 1 then PAGES
                                else NULL
                              end,
        FILTER_CONDITION    = FILTER_CONDITION

    from
        sys.fn_remote_indexes (
                @table_server,
                @table_catalog,
                @table_schema,
                @index_name,
                NULL,           -- TYPE (index type)
                @table_name)
    where
        @is_unique is null or @is_unique = [UNIQUE]
    order by NON_UNIQUE, TYPE, INDEX_QUALIFIER, INDEX_NAME, ORDINAL_POSITION

 
Last revision 2008RTM
See also

  sp_indexes_100_rowset (Procedure)
sp_indexes_100_rowset2 (Procedure)
sp_indexes_90_rowset (Procedure)
sp_indexes_90_rowset2 (Procedure)
sp_indexes_90_rowset_rmt (Procedure)
sp_indexes_managed (Procedure)
sp_indexes_rowset (Procedure)
sp_indexes_rowset2 (Procedure)
sp_indexes_rowset_rmt (Procedure)
       



News

  Query a named instance
Sybase+ASE+silent+install
SQL 2008 R2
Deprecated procedures in SQL2008
Reporting Services item-level role definitions
Create all your missing indexes
Converting datetime field
Start MSSQL Server Profiler at time
Replicating MSSQL Server views
Exploring Microsoft Sharepoint
The OLE DB provider "SQLNCLI10" for linked server indicates.
Mobile solar charger
Oracle to SQL Server replication
Cannot insert the value NULL into column
Undocumented Microsoft SQL Server 2008
VMware
Zoekmachine optimalisatie
SQL Servers hidden objects
FckEditor
Flash in Ajax
De hype die AJAX heet
Barcode scannen
MySQL; Gratis, makkelijk en snel!
PHP
sIFR; de combinatie tussen HTML en Flash