Multiple choice technology databases

Your company has created a custom application that will require the use of several stored procedures. The lifetime of this application is relatively short and you wish to create the stored procedures such that they can all be dropped with a single DROP PROCEDURE statement command at the end of the application's lifetime. How can you group the procedures together such that they can all be dropped with a single DROP PROCEDURE statement?

  1. Create each procedure with a distinct name followed by a semi-colon and a group name.

  2. Create each procedure with a distinct name followed by a semi-colon and a group number.

  3. Create each procedure with the same name followed by a semi-colon and a group name.

  4. Create each procedure with the same name followed by a semi-colon and a distinct number.

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

In SQL Server, stored procedures can be grouped by giving them the same name followed by a semicolon and a distinct number (e.g., 'procname;1', 'procname;2'). This allows dropping the entire group with a single DROP PROCEDURE statement. Options A and B are wrong - the names must be identical, not distinct. Option C is wrong because it needs distinct numbers, not a group name.