SQL 2005 中有哪些选项可用于将多个值传递给存储过程
伪代码
在 C# 代码中
List<string> myApplicationList;
.... (code to assign values)
**Construct parameter list**
Call stored procedure [spSelectMaster] with myApplicationList
SQL存储过程
CREATE PROCEDURE [Ecn].[spSelectMaster]
**Need to declare parameter here but not sure what this would be**
AS
BEGIN
SET NOCOUNT ON
SELECT *
FROM [dbo].[Master]
WHERE [Master].[ApplicationKey] IN (@ApplicationList)
END
GO
提前致谢
SQL Server 2005 T-SQL 中没有对数组的内置支持,但您可以解决此问题:
SQL Server 2005 中的数组和列表
如何将值列表或数组传递给 SQL Server 存储过程?
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)