开发者

Check that index file exists

开发者 https://www.devze.com 2022-12-09 06:15 出处:网络
I have created an index on my table like this: CREATE INDEX index_typ_poplatky O开发者_开发问答N Auta (typ DESC, poplatok_denny DESC, poplatok_km DESC);

I have created an index on my table like this:

CREATE INDEX index_typ_poplatky
    O开发者_开发问答N Auta (typ DESC, poplatok_denny DESC, poplatok_km DESC);

How to I check that the index file exists?


To check when connected as the schema owner:

select index_name from user_indexes
where index_name = 'INDEX_TYP_POLATYKY';

or

select index_name from user_indexes
where table_name = 'AUTA';

Note that the index name and table name are stored in uppercase.

You can also select from USER_IND_COLUMNS to find out the columns that are indexed:

select column_name
from user_ind_columns
where index_name = 'INDEX_TYP_POLATYKY'
order by column_position;


IF EXISTS (SELECT * FROM sys.indexes WHERE object_id = OBJECT_ID(N'[dbo].[table name]') AND name = N'index name')

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号