What does collation mean?

Collation can be simply thought of as sort order. In English (and it’s strange cousin, American), collation may be a pretty simple matter consisting of ordering by the ASCII code. Once you get into those strange European languages with all their accents and other features, collation changes. For example, though the different accented forms of … Read more

Real life example, when to use OUTER / CROSS APPLY in SQL

Some uses for APPLY are… 1) Top N per group queries (can be more efficient for some cardinalities) SELECT pr.name, pa.name FROM sys.procedures pr OUTER APPLY (SELECT TOP 2 * FROM sys.parameters pa WHERE pa.object_id = pr.object_id ORDER BY pr.name) pa ORDER BY pr.name, pa.name 2) Calling a Table Valued Function for each row in … Read more