帮助理解 SQL 存储过程参数
我是 SQL 新手,现在正在使用存储过程。 我在看另一个开发人员的代码时,看到了这样的说法:
ALTER PROCEDURE [deleteRecords_UNICODE]
@RecordIDs ty_NumberList READONLY
问题1:“ty_NumberList”是什么意思?
问题2:我正在创建一个需要使用上述参数的存储过程。 当我创建“DECLARE @RecordNum int”时,我显然收到了错误
Operand type clash: int is incompatible with ty_NumberList
我猜我必须通过以下方式解决此问题:
a) 创建“ty_NumberList”类型的变量
b) 然后按照我通常的 DECLARE @RecordNum int
c) 然后将@RecordNum 的值传递到ty_NumberList
问题3:我将如何在SQL 中实现上述步骤?
任何帮助将不胜感激!
I'm new to SQL and am now working with stored procedures.
I was watching another developer's code and I saw this statement:
ALTER PROCEDURE [deleteRecords_UNICODE]
@RecordIDs ty_NumberList READONLY
Question 1: What does the "ty_NumberList" mean?
Question 2: I'm creating a stored procedure that needs to use the above parameter.
When I created "DECLARE @RecordNum int", I obviously got the error of
Operand type clash: int is incompatible with ty_NumberList
I'm guessing I have to resolve this by:
a) Creating a variable of type "ty_NumberList"
b) then go with my usual DECLARE @RecordNum int
c) Then pass the value of @RecordNum into ty_NumberList
Question 3: How would I go about implementing the above steps in SQL?
Any help would be greatly appreciated!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
ty_NumberList
是表值参数。你会像这样使用它
ty_NumberList
is the type of a table valued parameter.You would use it like
该代码使用表值参数,请在在线书籍中阅读:
That code is using
Table-Valued Parameter
s, read up on it in Books On Line: http://msdn.microsoft.com/en-us/library/bb510489.aspx