Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Coverting the GROUP_CONCAT command

Author  Topic 

dave_gordon
Starting Member

2 Posts

Posted - 2010-02-23 : 06:13:18
I am new to SQL and would be extremely grateful if someone could help convert the following code to be SQL 2005 compatible;

SELECT res.resourcename 'Resources',
GROUP_CONCAT(attach.RESOURCENAME SEPARATOR '\n') 'Attached Asset',
GROUP_CONCAT(COMPONENTNAME SEPARATOR '\n') 'Component'
FROM REsources res LEFT JOIN
ResourceAssociation resa ON res.resourceid = resa.ASSTTORESOURCEID LEFT JOIN
Resources attach ON resa.RESOURCEID = attach.RESOURCEID LEFT JOIN
ComponentDefinition cd ON attach.COMPONENTID = cd.COMPONENTID
GROUP BY 1
ORDER BY 1

Many thanks in advance
Regards
Dave

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2010-02-23 : 06:15:40
Instead of GROUP_CONCAT, use this code and make it as a function
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=81254

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

dave_gordon
Starting Member

2 Posts

Posted - 2010-02-23 : 06:56:47
Thank yot for the prompt reply.

Does this make a difference if this is a MS SQL View that is used by ODBC to draw the data into MS Vision?

If not can you post me to the actual post date/time to try and use. Sorry I'm new to this so need all the help I can. I fund this code on a another formum posting, so did not develop myself, and am simply trying to copy and integrate for our own needs.
Go to Top of Page
   

- Advertisement -