Solved

IsIndexable command

Posted on 2011-09-16
6
275 Views
Last Modified: 2012-05-12
Anyone have syntax for IsIndexable command
0
Comment
Question by:TimSweet220
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

 
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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
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
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.

756 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