Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

When declaring a variable in an SQL statement, what character(s) precedes the va

ID: 3579805 • Letter: W

Question

When declaring a variable in an SQL statement, what character(s) precedes the variable name?

< >

< >

##

< >< >

##

< >

< >

If the @@CURSOR_ROWS value is -1, what does that tell you?

No rows were returned by the cursor

It is a dynamic cursor

The cursor is not open

It is a static cursor

You have the following SQL code, when will it execute?

CREATE TRIGGER example

ON Sales.Customer

AFTER INSERT, UPDATE

AS

THROW 50002, 'Notify Customer Relations', 1);

After the INSERT and the UPDATE have been performed

Before the Insert but after the Update has been performed

After the Insert or the Update has been performed

After the Insert but before the update has been performed

Explanation / Answer

1> The syntax to declare variables in SQL using the DECLARE statement is:   

for eg : DECLARE @NewName VARCHAR(50);
SET @
NewName = 'Jack';

=========================================

2> If the @@CURSOR_ROWS value is -1, then we can say that the cursor is dynamic. Because dynamic cursors reflect all changes, the number of rows that qualify for the cursor is constantly changing. It can never be definitely stated that all qualified rows have been retrieved.

====================================

3> The trigger will execute After the Insert or the Update has been performed. It will execute after either of the two DML statements INSERT and UPDATE.

feel free to ask if you have any doubt :)

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote