我如何在SQL Server中插入数组 [英] how i can insert array in sql server

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

问题描述

大家好

我该怎么做

我有字符串x =''1,2,3,4''
和字符串y =用户名''

我怎么能分割这x



插入表名(id,username)
值(用户名",1)

插入表名(id,username)
值(用户名",2)

插入表名(id,username)
值(用户名",3)
插入表名(id,username)
值(用户名",4)

hi everyone

how i can do that

i have string x = ''1,2,3,4''
and string y=''user name''

how i can split this x

as

insert into tablename (id,username)
values (''user name'',1)

insert into tablename (id,username)
values (''user name'',2)

insert into tablename (id,username)
values (''user name'',3)
insert into tablename (id,username)
values (''user name'',4)

推荐答案

开始^ ].


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

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