Week 11 Flashcards

1
Q

A stored procedure has to be executed by a ________, while a trigger is executed by the _______ as the result of an event.

A

user, system

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

Events that cause triggers to be activated include data ________, updates and ________.

A

Events that cause triggers to be activated include data inserts, updates and deletes.

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

One drawback to using ________ instead of ___________ is that they cannot accept parameters.

A

triggers, stored procedures

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

Stored procedure are for _______ actions or ________ actions

A

repetitive, complex

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

Triggers are enforcing business rules or _________.

A

protection

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

After creating a stored procedure what is the next step?

A

Parameters can be passed into the procedure

using @

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

SQL Server has many built-in stored procedures, called _______ _________ ____________

A

System Stored Procedures

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

Store procedure Usage Examples:

A

EXEC sp_tables
EXEC sp_tables @table_name = ‘Employee’
EXEC sp_tables @table_owner = ‘HumanResources’

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

How to you create a stored procedure?

A

starts with EXEC with
prefix sp_(tablename)
add parameters with @(tablename)

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

How do store procedure help the security of your database?

A

execute commands without permission in a controlled manner
•Execute As•Reduce/ eliminate SQL injection attacks
•Procedure can be encrypted to prevent copying and modifying
•Table/columns, etc are hidden from caller

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

What are some benefits of stored procedures?

A

Speed
Easier maintenance
Reduced network traffic
security

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

What commands in T-SQL are used to update a stored procedure and create a new one

A

UPDATE PROCEDURE

CREATE PROCEDURE

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

What are the two types of triggers?•

A

Data Manipulation Language (DML)

Data Definition Language (DDL)

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