Microsoft
Software
Hardware
Network
Question : Insert multiple rows into one field
I am running this query
SELECT CONVERT(VARCHAR(10),CardOT
BID) + ' ' + CONVERT(VARCHAR(20),Curren
tBalance)
FROM CardOTB_T_EC
WHERE CurrentBalance > @Amount
I want the results to go into one field so I can insert them into one row of a table.
Does anyone know how to do this?
Answer : Insert multiple rows into one field
declare @res varchar(8000)
SELECT @Res = COALESCE(@res+',' , '' )+ CONVERT(VARCHAR(10),CardOT
BID) + ' ' + CONVERT(VARCHAR(20),Curren
tBalance)
FROM CardOTB_T_EC
WHERE CurrentBalance > @Amount
---now you can insert @res into the other table
Random Solutions
extend Windows Server 2003 group policy to suport Vista / 7
Access 2007 Webbrowser Active X Control
Object required error on if statement
Facebook Home page won't load
SQL Mail does not work with the 64-bit version of SQL Server
Receive an error when migrating site to MOSS 2007
Install SQL 2008 tools only
Access 2007 Combo Box populate multiple fields in form
MYSQL Webservice Vb.net
Hook and modify Windows Messages (even under Windows CE)