In this article we will see the way execution order works in SQL server, mainly when TOP, Union and order by clause are utilized in a query.
Say we have an Employee table
create table Employees
(EmployeeID int identity(1,1) NOT NULL
,EmployeeName varchar(50) NOT NULL default 'N/A'
,Department varchar(50) NOT NULL default 'N/A'
,Salary float NOT NULL default 0) [More]