Skip to main content
17 events
when toggle format what by license comment
Apr 25, 2019 at 20:00 audit Triage
Apr 25, 2019 at 20:00
Apr 25, 2019 at 8:17 audit Triage
Apr 25, 2019 at 8:18
Apr 22, 2019 at 17:12 audit Triage
Apr 22, 2019 at 17:39
Apr 18, 2019 at 21:04 audit Triage
Apr 18, 2019 at 22:00
Apr 16, 2019 at 13:29 audit Triage
Apr 16, 2019 at 13:29
Apr 15, 2019 at 6:56 audit Triage
Apr 15, 2019 at 7:08
Apr 11, 2019 at 0:52 audit Triage
Apr 11, 2019 at 0:52
Apr 8, 2019 at 4:04 audit Triage
Apr 8, 2019 at 4:04
Mar 27, 2019 at 6:13 comment added gkb @MatBailie - The sample presented here is way too simplified in comparison to the actual case just to avoid unnecessary confusions. Actually there are several other tables involved and the things that need to be shown as comma separated values are too small in significance to send and store repeated rows for them at the presentation layer, yet significant enough feature wise..For this sample though, what you suggested completely makes sense..
Mar 27, 2019 at 6:04 comment added gkb @Larnu - The doubt was never about how to generate the list, but where..Like Yogesh mentioned in his answer, I thought the function was being called multiple times and hence slowing the query down..
Mar 27, 2019 at 6:01 vote accept gkb
Mar 26, 2019 at 14:53 answer added Yogesh Sharma timeline score: 5
Mar 26, 2019 at 14:50 comment added Thom A Why do you think the first script isn't "the best"? That's normally how a delimited list was created in SQL Server (until SQL Server 2017).
Mar 26, 2019 at 14:50 comment added gkb I am using SQL Server 2016...I have read about the string aggregation but unfortunately its from 2017 onwards..
Mar 26, 2019 at 14:44 comment added MatBailie Which version of SQL Server? From SQL Server 2017 onwards, you may be better off using STRING_AGG()? (Also, if this is only for display purposes, it's normally advised that such processing is done in your presentation layer, out side of sql. Closely coupling your data layer and your presentation layer creates merry havoc in the future. Such as later wanting to be able to pick an item from the list, but finding out that the list items themselves can contain commas. At that time you'll be longing for a normalised structure keeping the names separate and having a column with the ids.)
Mar 26, 2019 at 14:44 comment added Yogesh Sharma What SQL Server version you are using ?
Mar 26, 2019 at 14:41 history asked gkb CC BY-SA 4.0