Solved

IsIndexable command

Posted on 2011-09-16
6
272 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
Zoho SalesIQ

Hassle-free live chat software re-imagined for business growth. 2 users, always free.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
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.

911 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now