Schemabinding Flashcards
What can you use SchemaBinding with?
Creating a view or function
What does Schemabinding do?
Binds the structure of any underlying table or view
You can not change ______ of a database with schemabound objects.
collation
True or False?
You can use Select * in a schemabound view?
False
True or False? You can make any change to the table that do not affect the structure of the schemabound columns.
True
Where can you look to see if an object (Column or Function) is schemabound?
Column: is_schema_bound in sys.sql_modules
Function: OBJECTPROPERTY
Objects that are bound (tables/views) can not be dropped while a schemabound object references them.
True or False
True
if you reference a view or function in a schemabound view or function then that view or function must also be what?
Schemabound
Schemabinding isn’t a commonly used tool unless you are setting up what?
An indexed view
When you use schmabinding, the select_statement, there are three objects that can be referenced, what are they?
Tables
Views
User-defined functions
True or False: when using schemabinding, all referenced objects must be in the same database?
True
Views or tables that participate in a view created with the schemabinding clause can or cannot be dropped unless that view is dropped or changed so that it no longer has schemabinding?
Cannot
List basic syntax order for creating a view with Schemabinding
5 Steps
CREATE VIEW WITH Schemabinding AS SELECT FROM
List basic syntax order for creating or altering a function with Schemabinding
4 Steps
CREATE or ALTER FUNCTION
RETURNS
WITH Schemabinding
AS
True or False: Stored procedure can be schemabound?
False