nerdexam
Microsoft

70-465 · Question #136

You use SQL Server 2014. You need to create a single object that inserts a provided value into Table1, and then returns a count of the records in Table1. Develop the solution by selecting and…

The correct answer is A. END D. Select @var1 = count(*) FROM Table1 F. CREATE PROCEDURE dbo.Spr_Table1 @InsertWord Varchar(10), @var1 INT OUTPUT AS BEGIN G. INSERT INTO TABLE1 (FIELD1) values (@InsertWord). The correct solution uses a stored procedure (F) with an OUTPUT parameter to both insert a value into Table1 and return a count. The procedure inserts the provided value (G), then uses SELECT to assign the row count to the OUTPUT parameter (D), and closes the procedure body…

Submitted by kavita_s· Mar 5, 2026Implementing Database Objects - Creating and managing stored procedures, understanding the differences between stored procedures and functions in SQL Server 2014.

Question

You use SQL Server 2014. You need to create a single object that inserts a provided value into Table1, and then returns a count of the records in Table1. Develop the solution by selecting and arranging the required code blocks in the correct order. You may not need all of the code blocks. Answer:

Exhibit

70-465 question #136 exhibit

Options

  • AEND
  • BCREATE FUNCTION dbo.Func_Table1 @InsertWord Varchar(10), @var1 INT OUTPUT AS BEGIN
  • CCREATE PROCEDURE dbo.Spr_Func_Table1 @InsertWord Varchar(10), @var1 INT AS BEGIN
  • DSelect @var1 = count(*) FROM Table1
  • EDeclare @var1 INT
  • FCREATE PROCEDURE dbo.Spr_Table1 @InsertWord Varchar(10), @var1 INT OUTPUT AS BEGIN
  • GINSERT INTO TABLE1 (FIELD1) values (@InsertWord);

How the community answered

(33 responses)
  • B
    9% (3)
  • C
    15% (5)
  • E
    3% (1)
  • F
    73% (24)

Explanation

The correct solution uses a stored procedure (F) with an OUTPUT parameter to both insert a value into Table1 and return a count. The procedure inserts the provided value (G), then uses SELECT to assign the row count to the OUTPUT parameter (D), and closes the procedure body with END (A). A stored procedure with an OUTPUT parameter is the correct object type here because it performs a DML operation (INSERT) and returns a value - functions cannot perform INSERT/UPDATE/DELETE on regular tables in SQL Server.

Topics

#Stored Procedures#OUTPUT Parameters#T-SQL#SQL Server Objects

Community Discussion

No community discussion yet for this question.

Full 70-465 Practice