如何在SQL Server 2005中插入值的数组? [英] How to INSERT an array of values in SQL Server 2005?

查看:97
本文介绍了如何在SQL Server 2005中插入值的数组?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在不进行简单迭代的情况下,将SQL代码写入INSERT(或UPDATE)值数组(可能带有伴随的字段名数组,或者同时包含它们的矩阵)?

How do I write the SQL code to INSERT (or UPDATE) an array of values (with probably an attendant array of fieldnames, or with a matrix with them both) without simple iteration?

推荐答案

我将列表构造为xml字符串,并将其传递给存储的proc。在SQL 2005中,它具有增强的xml功能,可以解析xml并进行批量插入。

I construct the list as an xml string and pass it to the stored procs. In SQL 2005, it has enhanced xml functionalities to parse the xml and do a bulk insert.

检查此信息:
将列表传递到SQL Server 2005 XML参数

这篇关于如何在SQL Server 2005中插入值的数组?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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