Help with understanding SQL stored procedure parameters

I am new to SQL and am now working with stored procedures. I watched another developer code and I saw this expression:

ALTER PROCEDURE [deleteRecords_UNICODE] @RecordIDs ty_NumberList READONLY 

Question 1: What does ty_NumberList mean?

Question 2: I am creating a stored procedure that should use the above parameter. When I created "DECLARE @RecordNum int", I obviously got an error

 Operand type clash: int is incompatible with ty_NumberList 

I assume that I should solve this:
a) Creating a variable of type "ty_NumberList"
b) then go with my regular DECLARE @RecordNum int
c) Then pass the value of @RecordNum to ty_NumberList

Question 3: How can I follow the steps above in SQL?

Any help would be greatly appreciated!

+4
source share
3 answers

ty_NumberList is the type of the table value parameter.

Would you use it as

 DECLARE @Nums AS ty_NumberList; INSERT INTO @Nums VALUES (1); EXEC YourProc @Nums; 
+4
source

This code uses Table-Valued Parameter s, read it in the On Line book: http://msdn.microsoft.com/en-us/library/bb510489.aspx

+1
source

Read it

ty_number means you have to tell us because its user data type

when declaring a stored procedure, the parameter

we do not need to use declare

create proc sample @name vanchar (20), @num varchar (20) Get started

Choose ...............

End

0
source

All Articles