click below
click below
Normal Size Small Size show me how
SQL
stored procedures, triggers, and cursors
| Question | Answer |
|---|---|
| converting program commands into instructions computer can understand | Compile |
| used to create new procedure | CREATE PROCEDURE |
| identifying all variables to be used in stored procedure | Declaration |
| used to run a stored procedure | EXECUTE |
| used to accept input from user | input parameter |
| used to store values located within a stored procedure | local variable |
| used to display data to output device | PRINT Statement |
| used to return results from functions | RETURN statement |
| one or more SQL statements stored inside a database | stored procedure |
| simplify/optimize performance of queries & improve security | stored procedures |
| used to create basic stored procedure in MS SQL Server | CREATE PROCEDURE |
| used to specify any SQL statements used within stored procedure | AS |
| to create a stored procedure all local variables must start with | @ |
| to give unique name and assign a data type to variable | declare |
| required to process stored procedure | EXECUTE |
| May be used to send e-mail and perform data validation | triggers |
| used to track changes made to tables and modify computed columns | triggers |
| enforce referential integrity rules and provide security | triggers |
| command used to create new trigger | CREATE TRIGGER |
| specifies operation that trigger is linked to | FOR |
| indicates table that trigger relates to | ON |
| stored procedure executed with INSERT UPDATE or DELETE statement | trigger |
| converts lowercase characters to uppercase characters | upper () function |
| delete a trigger | DROP TRIGGER |
| indicates new procedure is beginning | BEGIN statement |
| used to free result set by closing cursor | CLOSE statement |
| used to scroll through set of records to retrieve data | cursor |
| used to release all memory associated with cursor | DEALLOCATE statement |
| used to define cursor result set to be used for all cursor operations | DECLARE |
| tells DBMS that procedure is ending | END statement |
| used to specify which rows to retrieve | FETCH statement |
| used to open cursor | OPEN CURSOR statement |
| group of records retrieved by an SQL query | result set |
| sets condition for repeated execution of SQL stmt or stmt block | WHILE loop |