将来自多个控件的数据保存到表的单个列中.... [英] saving data from several controls into the single column of the table....
本文介绍了将来自多个控件的数据保存到表的单个列中....的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有3个文本框用于填写地址。在填写文本框后,我必须将该数据存储到逐行排序的表中的单个列中。看到底部...
没有名字地址
1 anu no 96
iti布局
mg路
banglore
请帮帮我......
I have 3 text boxes for filling address. After filling the text boxes i have to store that data into a single column in the table ordered line by line. see the bottom section...
no name address
1 anu no 96
iti layout
mg road
banglore
please help me......
推荐答案
试试这样....
Try like this....
declare @interest table (id int identity not null, ColA varchar(10) null, ColB varchar(10) null, ColC varchar(10) null)
insert into @interest (ColA, ColB, ColC)
values
(null, null, '1.1%')
,('3.2%', '1.1%', '2.0%')
declare @description table (id int identity not null, NewColumn varchar(30))
insert into @description (NewColumn)
(select coalesce(ColA,'0.0%')+', '+coalesce(ColB, '0.0%')+', '+coalesce(ColC,'0.0%')
from @interest)
select * from @description
(2 row(s) affected)
(2 row(s) affected)
id NewColumn
----------- ------------------------------
1 0.0%, 0.0%, 1.1%
2 3.2%, 1.1%, 2.0%
(2 row(s) affected)
这篇关于将来自多个控件的数据保存到表的单个列中....的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文