Solved

IsIndexable command

Posted on 2011-09-16
6
274 Views
Last Modified: 2012-05-12
Anyone have syntax for IsIndexable command
0
Comment
Question by:TimSweet220
  • 4
  • 2
6 Comments
 
LVL 33

Expert Comment

by:knightEknight
ID: 36551393
Do you mean this?

SELECT TABLE_TYPE, TABLE_NAME
  , OBJECTPROPERTY (OBJECT_ID(TABLE_NAME), 'IsIndexable') AS IsIndexable
FROM INFORMATION_SCHEMA.TABLES
0
 

Author Comment

by:TimSweet220
ID: 36551405
Sorry..need it for see if a View is indexable
0
 
LVL 33

Expert Comment

by:knightEknight
ID: 36551454
that should do it, no?

SELECT *
  , OBJECTPROPERTY (OBJECT_ID(TABLE_NAME), 'IsIndexable') AS IsIndexable
FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_NAME = 'NameOfYourView'
order by 4,2,3
0
Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

 
LVL 33

Expert Comment

by:knightEknight
ID: 36551467
For a view you can check the 'IsSchemaBound' property:

SELECT *
  , OBJECTPROPERTY (OBJECT_ID(TABLE_NAME), 'IsIndexable') AS IsIndexable
  , OBJECTPROPERTY (OBJECT_ID(TABLE_NAME),'IsSchemaBound') AS IsSchemaBound
FROM INFORMATION_SCHEMA.TABLES
--WHERE TABLE_NAME = 'NameOfYourView'
order by 4,2,3
0
 
LVL 33

Accepted Solution

by:
knightEknight earned 500 total points
ID: 36551473
I forgot to add this to the WHERE clause:

WHERE TABLE_TYPE = 'VIEW'
0
 

Author Closing Comment

by:TimSweet220
ID: 36560832
Excellent. Thank you.
0

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Everyone has problem when going to load data into Data warehouse (EDW). They all need to confirm that data quality is good but they don't no how to proceed. Microsoft has provided new task within SSIS 2008 called "Data Profiler Task". It solve th…
This article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question