April 30, 2012

sp_indexes_managed (Transact-SQL MetaData) Definition

Please note: that the following source code is provided and copyrighted by Microsoft and is for educational purpose only.
The meta data is from an SQL 2012 Server.

I have posted alot more, find the whole list here.

Goto Definition or MetaData

Definition:

sys.sp_indexes_managed(nvarchar @Catalog
, nvarchar @Owner
, nvarchar @Table
, nvarchar @Name)

MetaData:

   
create procedure sys.sp_indexes_managed
(
@Catalog sysname = NULL,
@Owner sysname = NULL,
@Table sysname = NULL,
@Name sysname = NULL
)
as
select
constraint_catalog = s_iv.constraint_catalog,
constraint_schema = s_iv.constraint_schema,
constraint_name = s_iv.constraint_name,
table_catalog = s_iv.table_catalog,
table_schema = s_iv.table_schema,
table_name = s_iv.table_name,
index_name = s_iv.index_name,
type_desc = s_iv.type_desc
from
sys.spt_indexes_view_managed s_iv
where
(s_iv.TABLE_CATALOG = @Catalog or (@Catalog is null)) and
(s_iv.TABLE_SCHEMA = @Owner or (@Owner is null)) and
(s_iv.TABLE_NAME = @Table or (@Table is null)) and
(s_iv.INDEX_NAME = @Name or (@Name is null))
order by table_name, index_name

No comments:

Post a Comment

Total Pageviews