0
Msg 1033, Level 15, State 1, Line 6
The ORDER BY clause is invalid in views, inline functions, derived tables, subqueries, and common table expressions, unless TOP or FOR XML is also specified.
Fix 1:
select '0','All',1 RN
union all
select *,ROW_NUMBER() over(order by Name) RN from (select '0' SNo,'Aa' Name
union all
select '0','Ab'
union all
select '0','A'
union all
select '0','Albama'
union all
select '0','Antartica')A order by RN
select '0','All',1 RN
union all
select *,ROW_NUMBER() over(order by Name) RN from (select '0' SNo,'Aa' Name
union all
select '0','Ab'
union all
select '0','A'
union all
select '0','Albama'
union all
select '0','Antartica')A order by RN
Fix 2:
select '0','All' Last_Name
union all
select * from (select top 100000000 * from
( select Source_Id,Last_Name from iasdata.dim_agent )a
order by Last_Name asc)a
union all
select * from (select top 100000000 * from
( select Source_Id,Last_Name from iasdata.dim_agent )a
order by Last_Name asc)a
- Ashif Ahamed . A
0Awesome Comments!