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
sql to copy data from table 1 to table 2 in sep databases
Problem Opening Access 2000 Front-End with Access 2003.
can disc stuck at stage 2 of 3
Get table name from column in a view
Newbie question: Using Access 2003 to access MS SQL server db
SharePoint: Error Moving File or Folder Cannot Read from Source File or Disk
how to keep the session variable alive until the user close the browser?
How do I programmatically set the recordsource in a subreport?
Automatically rename an Excel worksheet with previous days date, excluding weekends
Import SQL 2005 database example into SQL 2008