Solved

SQL - T-SQL Syntax Question

Posted on 2014-03-18
2
222 Views
Last Modified: 2014-03-18
I have a small table with LocationID and Year fields which I would like to manipulate into a view that can be used in a sproc to bind this and additional data to an asp.net control.  For each LocationID I am trying to concatenate the associated years (ordered DESC) into a comma-separated string field which will in turn be bound to my tooltip.

I think this should be doable but I am totally stuck on syntax.  Any helpful experts want to give me a start?  Thanks.
0
Comment
Question by:AJ0718
[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
2 Comments
 
LVL 40

Accepted Solution

by:
Kyle Abrahams earned 500 total points
ID: 39937913
See the stuff/ForXML path here:
http://sqlandme.com/2011/04/27/tsql-concatenate-rows-using-for-xml-path/

The article explains exactly what you're trying to do.
0
 

Author Closing Comment

by:AJ0718
ID: 39937960
Thank you!  I kept finding lots of articles but nothing that quite fit.
0

Featured Post

Space-Age Communications Transitions to DevOps

ViaSat, a global provider of satellite and wireless communications, securely connects businesses, governments, and organizations to the Internet. Learn how ViaSat’s Network Solutions Engineer, drove the transition from a traditional network support to a DevOps-centric model.

Question has a verified solution.

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

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
I have a large data set and a SSIS package. How can I load this file in multi threading?
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

696 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