USE [HRNet]
GO
/** Object: StoredProcedure [dbo].[DBA_GET_PEOPLE_MORE_THAN_ONE_SALARY] Script Date: 08/28/2018 15:24:02 **/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author: <Author,,Name>
-- Create date: 16/05/2018
-- Description: if the procedure get data/people, IS current needs to be unchecked.
-- =============================================
ALTER PROCEDURE [dbo].[DBA_GET_PEOPLE_MORE_THAN_ONE_SALARY]
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
-- Insert statements for procedure here
select FULLNAME, count() as 'Resolve Salary History for RefNumber'
from SalaryHistory inner join
people on people.people_id = salaryhistory.people_id
where iscurrent = 'T'
group by people.people_id, FULLNAME
having count() > 1
order by count(*) desc, FULLNAME
END
USE [HRNet] GO /** Object: StoredProcedure [dbo].[DBA_GET_PEOPLE_MORE_THAN_ONE_SALARY] Script Date: 08/28/2018 15:24:02 **/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO -- ============================================= -- Author: <Author,,Name> -- Create date: 16/05/2018 -- Description: if the procedure get data/people, IS current needs to be unchecked. -- ============================================= ALTER PROCEDURE [dbo].[DBA_GET_PEOPLE_MORE_THAN_ONE_SALARY] AS BEGIN -- SET NOCOUNT ON added to prevent extra result sets from -- interfering with SELECT statements. SET NOCOUNT ON; -- Insert statements for procedure here select FULLNAME, count() as 'Resolve Salary History for RefNumber' from SalaryHistory inner join people on people.people_id = salaryhistory.people_id
where iscurrent = 'T' group by people.people_id, FULLNAME having count() > 1 order by count(*) desc, FULLNAME END