在存储过程中创建运行时数组 [英] create run time array in stored procedure

查看:69
本文介绍了在存储过程中创建运行时数组的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨Frnds,
我想在存储过程中创建运行时数组吗?
感谢

Hi Frnds,
i want create run time array in stored procedure is it possible?
thanks

推荐答案

您无法创建真正的数组-MsSQL没有数组数据类型.

最好的办法是使用VARCHAR(MAX)并用(例如)逗号分隔的值填充它.
You can''t create a true array - MsSQL does not have an array datatype.

The best you can do is to use a VARCHAR(MAX) and fill it with (for example) comma separated values.


SQL Server没有数组数据类型,但是您可以使用表格类型.例如:如何将多个记录传递到存储过程 [
SQL Server doesn''t have an array data type but you can use table types. For example: How to pass multiple records to a Stored Procedure[^]


U可以使用临时表或表变量也
U can use temp table or table variable also


这篇关于在存储过程中创建运行时数组的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆