Please run this report:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
if object_id('sp_DBR_crosstab_order','P') is not null
drop procedure sp_DBR_crosstab_order
go
create procedure sp_DBR_crosstab_order
as
begin
select 'dbr.crosstab', 'Group';
select 'dbr.crosstab.order' , 'asc'
select 'dbr.hsum', 'Suma';
select 'dbr.sum', 'Suma';
select 'Name1' as name, 'A' as 'Group', 10 as Suma
union
select 'Name9' as name, 'O' as 'Group', 10 as Suma
union
select 'Name8' as name, 'Z' as 'Group', 10 as Suma
union
select 'Name2' as name, 'A' as 'Group', 10 as Suma
union
select 'Name2' as name, 'O' as 'Group', 10 as Suma
union
select 'Name2' as name, 'Z' as 'Group', 10 as Suma
end
go
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Crosstab columns are ordered:
A, O, Total, Z