Extra Notes Flashcards

1
Q

What is the difference in creating an Inline table-value function and Multistatement?

A

CREATE FUNCTION dbo.Inline(@var varchar(5))
RETURNS TABLE

CREATE FUNCTION dbo.MultiStatement(@var varchar(5))
RETURNS TABLE (OutVar varchar(5), OutVar2 int)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is the suitable FILLFACTOR setting for indexes on an OLTP table?

A

FILLFACTOR=0 - Means that it will fill in as many rows into a page as possible (85-90)

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

When should you use PAD_INDEX = OFF?

A

When you are not using FILLFACTOR

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

What does PAD_INDEX do for you?

A

Takes the percentage setting that is applied to the FILLFACTOR option and applies it to the intermediate level of the index.

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

What are the steps to create a FULL-TEXT Search?

A
  • Install FULL-TEXT Search
  • Create a full-text catalog
  • Create a unique, single-column, non-nullable index
  • Create the full-text index
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What does SET XACT_ABORT [ON, OFF] do?

A

Enables (ON) or disables (OFF) the ability for the insert statements to continue if an UPDATE statement fails.

IE: If XACT_ABORT is OFF and you have multiple insert statements, all of the statements will continue on even if one were to fail.

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

How can you make sure that multiple insert statements wait until all of the insert statements have been completed before COMMIT?

A

By using SET IMPLICIT_TRANSACTIONS ON

No commits will be done until expressly told to in the batch.

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

Can you use data compression on a table that includes a sparse column?

A

No.

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

Can you create a unique index on a column that has more than one NULL?

A

No, the second null would not be unique.

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

What does SCHEMABINDING do for a view?

A

Ensures that changes are not made to the underlying tables

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

What does WITH CHECK OPTION do for a view?

A

Ensures that any modifications to the underlying table adhere to specified criteria in the SELECT statement associated with the view

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

How can you modify multiple tables within a view?

A

Use an INSTEAD OF trigger. This will allow you to modify all of the tables specifically because they can’t be updated within the view.

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

What does SET STATISTICS TIME show you?

A

CPU and elapsed time for a query

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

What does SET STATISTICS IO show you?

A
Table
Scan
logical reads
physical reads 
read-ahead reads 
lob logical reads 
lob physical reads
lob read-ahead reads
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What does SET STATISTICS PROFILE show you?

A
  • Rows - Actual number of rows produced by each operator

* Executes - Number of times the operator has been executed

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

What does SET STATISTICS XML show you?

A

Execution information for each statement after executing it

17
Q

When should you use the Image datatype?

A

Never, it’s been depreciated.

18
Q

When creating a CLR function in T-SQL, do you need the parameter in the AS EXTERNAL NAME Assembly.Class.Method (Parameter)?

A

No, if you put the parameter there you’ll get an error.