Solved

Syntax to Insert Many Rows to One

Posted on 2008-10-15
6
211 Views
Last Modified: 2012-05-05
I'm trying to select many rows of data and insert them to on row separated by spaces example:

Table1
Debtor   Invoice
1               10
1               12
1               16
2                 4
5               20

I want to select all invoice numbers for Debtor 1 which are 10,12,16 and Insert them into my Note Table.

Note
Debtor      Note
1                10 12 16

Since I have so many different Debtor's that I'm dealing with I have a cursor set up, but I don't know how to set all of those invoice numbers to 1 Variable?
0
Comment
Question by:Nathan Riley
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
6 Comments
 
LVL 15

Expert Comment

by:jorge_toriz
ID: 22726514
Search for an udagg that concatenates your rows
0
 
LVL 11

Author Comment

by:Nathan Riley
ID: 22731938
udagg?
0
 
LVL 15

Expert Comment

by:jorge_toriz
ID: 22732237
Used Defined Aggregate... you can create your own aggregate using .net
0
Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

 
LVL 11

Author Comment

by:Nathan Riley
ID: 22734127
yeah, if I knew .net
0
 
LVL 15

Accepted Solution

by:
jorge_toriz earned 500 total points
ID: 22759277
Ups, there isn't other solution buddy
0
 
LVL 11

Author Closing Comment

by:Nathan Riley
ID: 31506509
Ok, thanks.
0

Featured Post

Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article we will learn how to fix  “Cannot install SQL Server 2014 Service Pack 2: Unable to install windows installer msi file” error ?
A Stored Procedure in Microsoft SQL Server is a powerful feature that it can be used to execute the Data Manipulation Language (DML) or Data Definition Language (DDL). Depending on business requirements, a single Stored Procedure can return differe…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.

627 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question