Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I query schema bound views?

I can list all views in SQL Server 2008 by using

SELECT * FROM sys.views

What I want to do is to list only the views that are schema bound. How can I do this?

like image 400
Brad Avatar asked Jan 12 '10 16:01

Brad


People also ask

How do you find the schema of a bound object?

We can check if an object is schema-bound using the system function OBJECTPROPERTY (object_id , 'is_schema_bound').

What is a schema-bound view?

Schema binding refers to the process of associating a database view to underlying tables in order to put indexes directly on the view. This may lead to great performance benefits when using the view; however, this tighter coupling is not without drawbacks.


1 Answers

SELECT * 
FROM sys.views 
WHERE OBJECTPROPERTY(object_id, 'IsSchemaBound') = 1
like image 151
Remus Rusanu Avatar answered Oct 21 '22 21:10

Remus Rusanu