Schemabinding Flashcards Preview

70-461 Querying Microsoft SQL Server 2012 > Schemabinding > Flashcards

Flashcards in Schemabinding Deck (20)
Loading flashcards...
1
Q

What can you use SchemaBinding with?

A

Creating a view or function

2
Q

What does Schemabinding do?

A

Binds the structure of any underlying table or view

3
Q

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

A

collation

4
Q

True or False?

You can use Select * in a schemabound view?

A

False

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

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

7
Q

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

A

True

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

9
Q

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

A

An indexed view

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

11
Q

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

A

True

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

13
Q

List basic syntax order for creating a view with Schemabinding

5 Steps

A
CREATE VIEW
	WITH Schemabinding
AS
SELECT
FROM
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

15
Q

True or False: Stored procedure can be schemabound?

A

False

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