top of page

Stored procedure with table parameter

You plan to create a stored procedure that uses a table parameter as an input parameter. The table value parameter may hold between 1 and 10,000 rows when you run the stored procedure.

The stored procedure will use the rows within the table value parameter to filter the rows that will be returned by the SELECT statement.

You need to create the stored procedure and ensure that it runs as quickly as possible. How should you complete the procedure? To answer, select the appropriate Transact-SQL segments in the answer area.

 

Discussion:

Bartek:

What a difference between @MyInputTable and #MyInputTable in last window ? In my opinion there should be #MyInputTable becouse nevertheless we are inserting rows from Table Param here

Jiacheng:

Read requirement carefully, he wants to return something from parameter table, so need to be @VariableTable in the last box

Answer Given:

References: https://docs.microsoft.com/en-us/sql/t-sql/statements/create-procedure-transact-sql?view=sql-server-2017


bottom of page