SQL Server Final
scalar
A local variable that can store a single value is called a/an ______________________________ variable.
table
A local variable that can store an entire result set is called a/an ______________________________ variable
OUTPUT
A parameter passes a value from the calling program to the stored procedure, unless you code the ______________________________ keyword.
script
A series of SQL statements that you can store in a file is called a/an ______________________________.
Base
A table that‟s used to create a view is called a/an ______________________________ table.
tempdb
A temporary table is stored in the system database named ______________________________.
SELECT
A view is a/an ______________________________ statement that‟s stored as an object in the database.
system catalog
All of the system objects that define a database are stored in the ______________________________.
SET @Name = 'Test'
Code a statement that assigns the value "Test" to a scalar variable named @Name that‟s declared with the varchar data type.
USE TestDB
Code a statement that changes the database context to a database named TestDB.
DECLARE @TestTable table
Code a statement that creates a table variable named @TestTable.
IF DB_ID('TestDB') IS NOT NULL
Code a statement that tests if the database named TestDB exists. _____________________________________________________________________
DEFAULT
If you code a column list in an INSERT statement that includes a column that‟s defined with a default value, you can insert the default value for that column by coding the ____________________ keyword in the VALUES clause of the INSERT statement.
ENCRYPTION WITH ENCRYPTION
If you want to prevent users from examining the SQL code that defines a procedure, function, or trigger, you code the CREATE statement with the ______________________________ option.
catalog
One way to examine the system objects that define a database is to use the ______________________________ views.
precompiled
Stored procedures execute faster than an equivalent SQL script because stored procedures are ______________________________.
IF...ELSE IF/ELSE IF
To control the flow of execution based on a true/false condition, you code a/an ______________________________ statement.
INTO
To create a new table by using a SELECT statement, you code the ___________________________ clause.
DROP VIEW
To delete an existing view, you use the ______________________________ statement.
GO
To divide a script into multiple batches, you use the ______________________________ command.
SQLCMD
To execute Transact-SQL scripts from a command line, you use the ______________________________ utility.
EXEC
To execute a dynamic SQL statement, you code a/an ______________________________ statement.
TRY...CATCH TRY/CATCH TRY
To handle errors caused by one or more SQL statements, you can use the ______________________________ statement.
Subquery
To insert several rows into a table with an INSERT statement, you code a/an ______________ in place of the VALUES clause.
default value
To make a parameter for a stored procedure optional, you assign it a/an ______________________________.
RAISERROR
To manually raise an error within a stored procedure, you use the ______________________________ statement.
.ALTER VIEW
To modify an existing view, you use the ______________________________ statement.
WHILE
To repeatedly execute a statement or set of statements, you code a/an ______________________________ statement.
To return a message to the client, you use the ______________________________ statement.
@@IDENTITY
To return the value of the most recently assigned identity column, you can use the ______________________________ system function.
triggers
Unless a database system supports declarative referential integrity, the only way to enforce referential integrity is to use ______________________________.
schema name
Unlike other database objects, when you invoke a user-defined function you must always include the ______________________________.
WHERE
When you code a DELETE statement for one or more rows, the _________________ clause specifies which row or rows are to be deleted.
Null
When you code a column list in an INSERT statement, you can omit columns with default values and columns that allow ____________________________ values.
Identity
When you code a column list in the INTO clause of an INSERT statement, you can‟t include a/an _____________________ column.
WHERE
When you code an UPDATE statement for one or more rows, the SET clause specifies the new data for the specified columns and the _________________ clause specifies which row or rows are to be updated.
DELETE Vendors DELETE FROM Vendors
Write the code for a DELETE statement that deletes every row in the Vendors table: _______________________________________________________________