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
Outlook xp exchange 2010
SQL Server 2005 Error, Ex_handle_except encountered exception C0000005 - Server terminating
Programmatically create IIS host header using VBScript / ASP?
MS Word 2007 :: Tables :: Prevent Page Break
Programatically create multiple paragraph to a Excel Cell
New Line in EditBox
Forms: Conditional Formatting (when field Is Not Null) on Tab Stop
How to retrieve data from five different tables in Access database
421 4.2.1 unable to connect for some domains
Illegal operation attempted on a registry key that has been marked for deletion