Schemabinding Flashcards

1
Q

What can you use SchemaBinding with?

A

Creating a view or function

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What does Schemabinding do?

A

Binds the structure of any underlying table or view

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

You can not change ______ of a database with schemabound objects.

A

collation

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

True or False?

You can use Select * in a schemabound view?

A

False

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

True or False? You can make any change to the table that do not affect the structure of the schemabound columns.

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Where can you look to see if an object (Column or Function) is schemabound?

A

Column: is_schema_bound in sys.sql_modules
Function: OBJECTPROPERTY

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Objects that are bound (tables/views) can not be dropped while a schemabound object references them.
True or False

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

if you reference a view or function in a schemabound view or function then that view or function must also be what?

A

Schemabound

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Schemabinding isn’t a commonly used tool unless you are setting up what?

A

An indexed view

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

When you use schmabinding, the select_statement, there are three objects that can be referenced, what are they?

A

Tables
Views
User-defined functions

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

True or False: when using schemabinding, all referenced objects must be in the same database?

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

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?

A

Cannot

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

List basic syntax order for creating a view with Schemabinding

5 Steps

A
CREATE VIEW
	WITH Schemabinding
AS
SELECT
FROM
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

List basic syntax order for creating or altering a function with Schemabinding

4 Steps

A

CREATE or ALTER FUNCTION
RETURNS
WITH Schemabinding
AS

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

True or False: Stored procedure can be schemabound?

A

False

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Schemabinding prevents ____ or _____ of any object on which the function depends?

A

Altering or dropping
Note: if a schema-bound function references a table, then columns may be added to the table, but no existing columns can be altered or dropped, and neither can the table itself.

17
Q

Indexed views must be created with which option?

A

With Schemabinding

18
Q

The Schemabinding option ensures that structural changes against referenced objects and columns will be what?

A

rejected

19
Q

What clause should you specify when creating a function that will ensure that the objects referenced in the function definition cannot be modified unless the function is also modified?

A

With Schemabinding

20
Q

True or False: When you use schmabinding, the select_statement must include two-part names that are referenced.

A

True