T-SQL - Check if view is SCHEMABINDING

5.1k Views Asked by At

I tried to google it, but didn't found an answer...

Is it possible to check if view is created with SCHEMABINDING?

2

There are 2 best solutions below

1
On BEST ANSWER

You've already accepted another answer, but the OBJECTPROPERTY() function can answer this directly:

select objectproperty(object_id('viewname'), 'IsSchemaBound')

Note also that sys.sql_dependencies is deprecated.

0
On

I'm not aware of a direct way, but you could run

select * 
from sys.sql_dependencies
where class = 1 and object_id = object_id('<view name>');

If it returns values, the view is bound.