Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to do inside quotes
Message
 
 
À
10/09/2013 20:47:55
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Versions des environnements
SQL Server:
SQL Server 6.5 and older
Application:
Web
Divers
Thread ID:
01582787
Message ID:
01582811
Vues:
33
>There are plenty of examples, but I need to run right now. If you would not find them, I'll look them up tonight.
>
>Naomi, I found them, and I found some of the specific threads on MSDN you and Erland and others participated in a few years back.
>
>Second, the specific issue with ORDER BY is if you use expressions in the ORDER BY - which I rarely use and I'd venture a guess most people who are using aggregation concatenation aren't using. But that was interesting to learn.
>
>Here's the MSDN link that covers the core issue, which has some interesting points...
>http://support.microsoft.com/default.aspx?scid=287515
>
>Note the workaround does not recommend against in-line aggregation concatenation; rather, it recommends against using expressions in an ORDER BY. This might be splitting hairs, but I would question the use of the word "undocumented" if Microsoft's own documentation states the following:
>
>In order to achieve the expected results from an aggregate concatenation query, apply any Transact-SQL function or expression to the columns in the SELECT list rather than in the ORDER BY clause.
>
>So I would state that so long as one doesn't use expressions in an ORDER BY, and deals with NULL values appropriately, I haven't seen anything that makes this less reliable than FOR XML.
>
>And I'm not saying that FOR XML is bad - I've used it, and so have many. It's just that the aggregation concatenation approach is a bit simpler.

I found a few threads myself one being http://social.msdn.microsoft.com/Forums/sqlserver/en-US/31804823-6e5e-4e2d-9729-330d12ccb880/dynamic-sql-stored-proc-with-informationschemacolumns where I used the "bad" solution for simplicity.

I just left a message for Erland in that thread.

The originating thread is this one http://social.msdn.microsoft.com/Forums/sqlserver/en-US/7b88ad77-e5ed-4888-82df-bd513c12cf02/on-string-aggregate-concatenation but I haven't re-read it yet.

I've just returned from the back to school night in my older son first freshman year in High School.
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform