USE [DBEnvigoHr]
GO
EXEC sys.sp_dropextendedproperty @name=N'MS_DiagramPaneCount' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'VIEW',@level1name=N'vwCandidatepool'

GO
EXEC sys.sp_dropextendedproperty @name=N'MS_DiagramPane1' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'VIEW',@level1name=N'vwCandidatepool'

GO
/****** Object:  View [dbo].[vwtblSuggestedApplicants]    Script Date: 18-03-2020 16:52:27 ******/
DROP VIEW [dbo].[vwtblSuggestedApplicants]
GO
/****** Object:  View [dbo].[vwtblApplicants]    Script Date: 18-03-2020 16:52:27 ******/
DROP VIEW [dbo].[vwtblApplicants]
GO
/****** Object:  View [dbo].[vwPosition]    Script Date: 18-03-2020 16:52:27 ******/
DROP VIEW [dbo].[vwPosition]
GO
/****** Object:  View [dbo].[vwCandidatepool]    Script Date: 18-03-2020 16:52:27 ******/
DROP VIEW [dbo].[vwCandidatepool]
GO
/****** Object:  Table [dbo].[tblUserLogin]    Script Date: 18-03-2020 16:52:27 ******/
DROP TABLE [dbo].[tblUserLogin]
GO
/****** Object:  Table [dbo].[tblSuggestedApplicants]    Script Date: 18-03-2020 16:52:27 ******/
DROP TABLE [dbo].[tblSuggestedApplicants]
GO
/****** Object:  Table [dbo].[tblPositions]    Script Date: 18-03-2020 16:52:27 ******/
DROP TABLE [dbo].[tblPositions]
GO
/****** Object:  Table [dbo].[tblMasterUnit]    Script Date: 18-03-2020 16:52:27 ******/
DROP TABLE [dbo].[tblMasterUnit]
GO
/****** Object:  Table [dbo].[tblMasterSource]    Script Date: 18-03-2020 16:52:27 ******/
DROP TABLE [dbo].[tblMasterSource]
GO
/****** Object:  Table [dbo].[tblMasterRole]    Script Date: 18-03-2020 16:52:27 ******/
DROP TABLE [dbo].[tblMasterRole]
GO
/****** Object:  Table [dbo].[tblMasterRating]    Script Date: 18-03-2020 16:52:27 ******/
DROP TABLE [dbo].[tblMasterRating]
GO
/****** Object:  Table [dbo].[tblMasterInterviewStatus]    Script Date: 18-03-2020 16:52:27 ******/
DROP TABLE [dbo].[tblMasterInterviewStatus]
GO
/****** Object:  Table [dbo].[tblMasterInterviewResult]    Script Date: 18-03-2020 16:52:27 ******/
DROP TABLE [dbo].[tblMasterInterviewResult]
GO
/****** Object:  Table [dbo].[tblMasterHiringStatus]    Script Date: 18-03-2020 16:52:27 ******/
DROP TABLE [dbo].[tblMasterHiringStatus]
GO
/****** Object:  Table [dbo].[tblMasterDesignation]    Script Date: 18-03-2020 16:52:27 ******/
DROP TABLE [dbo].[tblMasterDesignation]
GO
/****** Object:  Table [dbo].[tblMasterDepartment]    Script Date: 18-03-2020 16:52:27 ******/
DROP TABLE [dbo].[tblMasterDepartment]
GO
/****** Object:  Table [dbo].[tblMasterCandidatePool]    Script Date: 18-03-2020 16:52:27 ******/
DROP TABLE [dbo].[tblMasterCandidatePool]
GO
/****** Object:  Table [dbo].[tblJobDescription]    Script Date: 18-03-2020 16:52:27 ******/
DROP TABLE [dbo].[tblJobDescription]
GO
/****** Object:  Table [dbo].[tblInterviewRounds]    Script Date: 18-03-2020 16:52:27 ******/
DROP TABLE [dbo].[tblInterviewRounds]
GO
/****** Object:  Table [dbo].[tblApplicants]    Script Date: 18-03-2020 16:52:27 ******/
DROP TABLE [dbo].[tblApplicants]
GO
/****** Object:  Table [dbo].[tblApplicantRating]    Script Date: 18-03-2020 16:52:27 ******/
DROP TABLE [dbo].[tblApplicantRating]
GO
/****** Object:  Table [dbo].[tblApplicantComments]    Script Date: 18-03-2020 16:52:27 ******/
DROP TABLE [dbo].[tblApplicantComments]
GO
/****** Object:  Table [dbo].[tblAdminUsers]    Script Date: 18-03-2020 16:52:27 ******/
DROP TABLE [dbo].[tblAdminUsers]
GO
/****** Object:  StoredProcedure [dbo].[ProcAddUpdateLink]    Script Date: 18-03-2020 16:52:27 ******/
DROP PROCEDURE [dbo].[ProcAddUpdateLink]
GO
/****** Object:  StoredProcedure [dbo].[proc_tblUserLogin_Approve]    Script Date: 18-03-2020 16:52:27 ******/
DROP PROCEDURE [dbo].[proc_tblUserLogin_Approve]
GO
/****** Object:  StoredProcedure [dbo].[proc_tblUserLogin]    Script Date: 18-03-2020 16:52:27 ******/
DROP PROCEDURE [dbo].[proc_tblUserLogin]
GO
/****** Object:  StoredProcedure [dbo].[Proc_tblSuggestedApplicants_Select]    Script Date: 18-03-2020 16:52:27 ******/
DROP PROCEDURE [dbo].[Proc_tblSuggestedApplicants_Select]
GO
/****** Object:  StoredProcedure [dbo].[proc_tblSuggestedApplicants_ReOpen]    Script Date: 18-03-2020 16:52:27 ******/
DROP PROCEDURE [dbo].[proc_tblSuggestedApplicants_ReOpen]
GO
/****** Object:  StoredProcedure [dbo].[Proc_tblSuggestedApplicants_reject]    Script Date: 18-03-2020 16:52:27 ******/
DROP PROCEDURE [dbo].[Proc_tblSuggestedApplicants_reject]
GO
/****** Object:  StoredProcedure [dbo].[Proc_tblSuggestedApplicants_Approve]    Script Date: 18-03-2020 16:52:27 ******/
DROP PROCEDURE [dbo].[Proc_tblSuggestedApplicants_Approve]
GO
/****** Object:  StoredProcedure [dbo].[proc_tblSuggestedApplicants]    Script Date: 18-03-2020 16:52:27 ******/
DROP PROCEDURE [dbo].[proc_tblSuggestedApplicants]
GO
/****** Object:  StoredProcedure [dbo].[proc_tblPositions]    Script Date: 18-03-2020 16:52:27 ******/
DROP PROCEDURE [dbo].[proc_tblPositions]
GO
/****** Object:  StoredProcedure [dbo].[proc_tblMasterCandidatePool]    Script Date: 18-03-2020 16:52:27 ******/
DROP PROCEDURE [dbo].[proc_tblMasterCandidatePool]
GO
/****** Object:  StoredProcedure [dbo].[proc_tblJobDescription_Approve]    Script Date: 18-03-2020 16:52:27 ******/
DROP PROCEDURE [dbo].[proc_tblJobDescription_Approve]
GO
/****** Object:  StoredProcedure [dbo].[proc_tblJobDescription]    Script Date: 18-03-2020 16:52:27 ******/
DROP PROCEDURE [dbo].[proc_tblJobDescription]
GO
/****** Object:  StoredProcedure [dbo].[proc_tblApplicants]    Script Date: 18-03-2020 16:52:27 ******/
DROP PROCEDURE [dbo].[proc_tblApplicants]
GO
/****** Object:  StoredProcedure [dbo].[proc_tblApplicantRating]    Script Date: 18-03-2020 16:52:27 ******/
DROP PROCEDURE [dbo].[proc_tblApplicantRating]
GO
/****** Object:  StoredProcedure [dbo].[proc_tblApplicantComments]    Script Date: 18-03-2020 16:52:27 ******/
DROP PROCEDURE [dbo].[proc_tblApplicantComments]
GO
/****** Object:  StoredProcedure [dbo].[proc_tblApplicantComments]    Script Date: 18-03-2020 16:52:27 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
create proc [dbo].[proc_tblApplicantComments]
(
@CommentID int,
@ApplicantdID int,
@PositionID int,
@CommentedBy int,
@Comments nvarchar(2000)
)
As begin
if(@CommentID=0)
Begin
insert into tblApplicantComments (ApplicantdID,PositionID,CommentedBy,Comments,CreateDate)
values (@ApplicantdID,@PositionID,@CommentedBy,@Comments, CURRENT_TIMESTAMP)
End
if(@CommentID>0)
Begin
update  tblApplicantComments set
ApplicantdID=@ApplicantdID,
PositionID=@PositionID,
CommentedBy=@CommentedBy,
Comments=@Comments,
UpdatedDate=CURRENT_TIMESTAMP
where CommentID=@CommentID
End
end

GO
/****** Object:  StoredProcedure [dbo].[proc_tblApplicantRating]    Script Date: 18-03-2020 16:52:27 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE proc [dbo].[proc_tblApplicantRating]
(
@RoundID int,
@ApplicantID int,
@InterViewStatus int,
@InterviewResult int,
@rating float,
@CommunicationID int,
@Communication int,
@JobKnowledgeID int,
@JobKnowledge int,
@PastExperienceID int,
@PastExperience int,
@CompanyFitnessID int,
@CompanyFitness int,
@AttitudeID int,
@Attitude int,
@UserID int
)
as 
Begin
Declare @positionID int,@CandidateID int
Select @positionID=PositionID,@CandidateID=CandidateID from tblApplicants where ApplicantID=@ApplicantID
if(@InterViewStatus=6)
Begin
update tblInterviewRounds set InterviewStatus=@InterviewStatus,
InterviewResult=@InterviewResult,
Rating=@Rating,
updatedate=current_TimeStamp,
updatedby=@UserID
where RoundID=@RoundID
if(@InterviewResult=1)
Begin
update tblApplicants set stage=5 where ApplicantID=@ApplicantID
end
if(@InterviewResult=5)
Begin
update tblApplicants set stage=3 where ApplicantID=@ApplicantID
end
if(@InterviewResult=2 or @InterviewResult=3 or @InterviewResult=4)
Begin
update tblApplicants set stage=2 where ApplicantID=@ApplicantID
end
insert into tblApplicantRating(RoundID,ApplicantID,RatingID,Rating,AddedBy,CreateDate)
Values(@RoundID,@ApplicantID,@CommunicationID,@Communication,@USerID,CURRENT_TIMESTAMP)
insert into tblApplicantRating(RoundID,ApplicantID,RatingID,Rating,AddedBy,CreateDate)
Values(@RoundID,@ApplicantID,@JobKnowledgeID,@JobKnowledge,@USerID,CURRENT_TIMESTAMP)
insert into tblApplicantRating(RoundID,ApplicantID,RatingID,Rating,AddedBy,CreateDate)
Values(@RoundID,@ApplicantID,@PastExperienceID,@PastExperience,@USerID,CURRENT_TIMESTAMP)
insert into tblApplicantRating(RoundID,ApplicantID,RatingID,Rating,AddedBy,CreateDate)
Values(@RoundID,@ApplicantID,@CompanyFitnessID,@CompanyFitness,@USerID,CURRENT_TIMESTAMP)
insert into tblApplicantRating(RoundID,ApplicantID,RatingID,Rating,AddedBy,CreateDate)
Values(@RoundID,@ApplicantID,@AttitudeID,@Attitude,@USerID,CURRENT_TIMESTAMP)
end
else
if(@InterViewStatus=5)
Begin
update tblPositions set Status='Closed',updatedby=@UserID,Updateddate=current_timeStamp where PositionID=@PositionID

--Update Candidate Interview Status to be Position Filled
update r set InterviewStatus=5 from tblInterviewRounds r inner join (select rounds.ApplicantID,RoundID,PositionID,Rank() over (Partition BY PositionID,rounds.CandidateID ORDER BY rounds.Createdate desc ) AS Rank from tblInterviewRounds rounds inner join tblapplicants apl on (rounds.ApplicantID=apl.ApplicantID) ) as t on(r.RoundID=t.roundid)   where positionID=@PositionID and rank=1

--Update other Candidate when position filled in Candidate Pool as Active=0
update tblMasterCandidatePool set Active=0 where CandidateID in (select CandidateID from tblApplicants where positionID=@positionID and Stage<3)

--release or recycle those candidate who are approved for post and in the process of interview but didn't completed till filling positions
delete tblSuggestedApplicants where positionID=@positionID and Candidate in (select CandidateID from tblApplicants where positionID=@positionID and Stage<3) 
End
if(@InterViewStatus=4)
Begin
update tblPositions set Status='OnHold',updatedby=@UserID,Updateddate=current_timeStamp where PositionID=@PositionID

--Update Candidate Interview Status to be Position OnHold
update r set InterviewStatus=4 from tblInterviewRounds r inner join (select rounds.ApplicantID,RoundID,PositionID,Rank() over (Partition BY PositionID,rounds.CandidateID ORDER BY rounds.Createdate desc ) AS Rank from tblInterviewRounds rounds inner join tblapplicants apl on (rounds.ApplicantID=apl.ApplicantID) ) as t on(r.RoundID=t.roundid)   where positionID=@PositionID and rank=1

--Update other Candidate when position filled in Candidate Pool as Active=0
update tblMasterCandidatePool set Active=0 where CandidateID in (select CandidateID from tblApplicants where positionID=@positionID and Stage<3)

--release or recycle those candidate who are approved for post and in the process of interview but didn't completed till filling positions
delete tblSuggestedApplicants where positionID=@positionID and Candidate in (select CandidateID from tblApplicants where positionID=@positionID and Stage<3) 
End
if(@InterViewStatus<4)
Begin
update tblInterviewRounds set 
InterviewStatus=@InterviewStatus,
updatedate=current_TimeStamp,
updatedby=@UserID
where RoundID=@RoundID
end
end


GO
/****** Object:  StoredProcedure [dbo].[proc_tblApplicants]    Script Date: 18-03-2020 16:52:27 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE proc [dbo].[proc_tblApplicants]
(
@PositionID int,
@CandidateID int,
@NoticePeriodDays int,
 @CurrentSalary float,
 @ExpectedSalary float,
 @RaisePercentage float,
 @Last_Appraised_On nvarchar(50),
 @IsBuyout nvarchar(50),
 @BuyoutCost float,
 @interviewType nvarchar(50),
 @interviewer int,
 @interviewdate datetime,
 @Stage int,
  @UserID int
)
As
Begin
declare @count int,@applicantID int,@countRound int
Select @count=count(1) from tblApplicants where PositionID=@PositionID and CandidateID=@CandidateID
if(@count=0)
begin
insert into tblApplicants(PositionID,CandidateID,NoticePeriodDays,CurrentSalary,ExpectedSalary,RaisePercentage,Last_Appraised_On,IsBuyout,BuyoutCost,Stage,createdate,addedby)
values(@PositionID,@CandidateID,@NoticePeriodDays,@CurrentSalary,@ExpectedSalary,@RaisePercentage,@Last_Appraised_On,@IsBuyout,@BuyoutCost,@Stage,CURRENT_TIMESTAMP,@UserID)
set @applicantID=IDENT_CURRENT('tblApplicants')
end
if(@count>0)
Begin
Select @applicantID=ApplicantID from tblApplicants where PositionID=@PositionID and CandidateID=@CandidateID
update tblApplicants set
NoticePeriodDays=@NoticePeriodDays,
CurrentSalary=@CurrentSalary,
ExpectedSalary=@ExpectedSalary,
RaisePercentage=@RaisePercentage,
Last_Appraised_On=@Last_Appraised_On,
IsBuyout=@IsBuyout,
BuyoutCost=@BuyoutCost,
Stage=@Stage,
updatedate=CURRENT_TIMESTAMP,
addedby=@UserID
where PositionID=@PositionID and CandidateID=@CandidateID
set @applicantID=IDENT_CURRENT('tblApplicants')
end
select @countRound=count(1) from tblInterviewRounds where ApplicantID=@applicantID
if(@countRound=0)
Begin
insert into tblInterviewRounds (ApplicantID,CandidateID,RoundType,Interviewer,SheduledOn,InterviewStatus
,createdate,addedby)
values(@applicantID,@CandidateID,@interviewType,@interviewer,@interviewdate,1,CURRENT_TIMESTAMP,@UserID)
end
--if(@countRound>1)
--begin
--update tblInterviewRounds set
--RoundType=@interviewType,
--Interviewer=@interviewer,
--SheduledOn=@interviewdate,
--updatedate=CURRENT_TIMESTAMP,
--updatedby=@UserID
--where ApplicantID=@applicantID
--end
update tblMasterCandidatePool set ApplicantDate=CURRENT_TIMESTAMP,LastApplicantID=@applicantID,Active=1 
where CandidateID=@CandidateID
if(@Stage=4)
Begin
--Update Candidate after selection in Candidate Pool as Active =2
update tblMasterCandidatePool set Active=2 where CandidateID=@CandidateID
--Update other Candidate after selection in Candidate Pool as Active=0
update tblMasterCandidatePool set Active=0 where active=1 and CandidateID in (select CandidateID from tblApplicants where positionID=@positionID)
--Update Candidate Interview Status to be Position Filled
update r set InterviewStatus=5 from tblInterviewRounds r inner join (select rounds.ApplicantID,RoundID,PositionID,Rank() over (Partition BY PositionID,rounds.CandidateID ORDER BY rounds.Createdate desc ) AS Rank from tblInterviewRounds rounds inner join tblapplicants apl on (rounds.ApplicantID=apl.ApplicantID) ) as t on(r.RoundID=t.roundid)   where positionID=@PositionID and rank=1
--update tblposition against selected candidate
update tblPositions set Closure_Date=CURRENT_TIMESTAMP,SelectedCandidateID=@CandidateID,Status='Closed',updatedby=@UserID,Updateddate=current_timeStamp where PositionID=@PositionID
--release or recycle those candidate who are approved for post and in the process of interview but didn't completed till filling positions
delete tblSuggestedApplicants where positionID=@positionID and Candidate in (select CandidateID from tblApplicants where positionID=@positionID and Stage<3) 
End
if(@Stage=5)
Begin
update tblMasterCandidatePool set Active=3 where CandidateID=@CandidateID

End
end


GO
/****** Object:  StoredProcedure [dbo].[proc_tblJobDescription]    Script Date: 18-03-2020 16:52:27 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE proc [dbo].[proc_tblJobDescription]
(
@PositionID int,
@JobDescription nvarchar(max),
@UserID int,
@nstatus int out,
@ApproveStatus int
)
as Begin
declare @count int
select @count=count(1) from tblJobDescription where PositionID=@PositionID
if(@count=0)
Begin
insert into tblJobDescription (PositionID,JobDescription,AddedBy,ApproveStatus,CreateDate)
values(@PositionID,@JobDescription,@UserID,@ApproveStatus,CURRENT_TIMESTAMP)
set @nstatus=1
end
if(@count>0)
Begin
update tblJobDescription set 
JobDescription=@JobDescription,
UpdatedBy=@UserID,
UpdatedDate=CURRENT_TIMESTAMP,
ApproveStatus=@ApproveStatus
where PositionID=@PositionID
set @nstatus=2
end
update tblPositions set JDStatus=@ApproveStatus where PositionID=@PositionID
return @nstatus
end


GO
/****** Object:  StoredProcedure [dbo].[proc_tblJobDescription_Approve]    Script Date: 18-03-2020 16:52:27 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE proc [dbo].[proc_tblJobDescription_Approve]
(
@PositionID int,
@ApproveStatus int,
@UserID int
)
as begin
update tblJobDescription set
ApproveStatus=@ApproveStatus,
ApprovedBy=@UserID,
ApprovedDate=CURRENT_TIMESTAMP
where PositionID=@PositionID
update tblPositions set JDStatus=@ApproveStatus where PositionID=@PositionID
end


GO
/****** Object:  StoredProcedure [dbo].[proc_tblMasterCandidatePool]    Script Date: 18-03-2020 16:52:27 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
create proc [dbo].[proc_tblMasterCandidatePool]
(
@CandidateID int,
@Name nvarchar(50),
@gender nvarchar(10),
@Experience numeric(4,2),
@EmailID nvarchar(50),
@Phone nvarchar(20),
@Education nvarchar(50),
@Year_of_Passing nvarchar(5),
@InterestedDepartmentID int,
@ProfessionalSummary nvarchar(500),
@LastCompany nvarchar(50),
@PrimaryIndustry nvarchar(50),
@PreviousNotableOrganisations nvarchar(500),
@CandidateStatus nvarchar(50),
@Source nvarchar(50),
@SourcingDate datetime,
@LastContactedDate datetime,
@ResumeGoogleLink nvarchar(1000),
@ResumeName nvarchar(500),
@addedby int,
@nid int out
)
as
Begin
declare @count int
select @count=count(1) from tblMasterCandidatePool where CandidateID=@CandidateID
if(@count=0)
begin
insert into tblMasterCandidatePool (Name,Gender,Experience,EmailID,Phone,Education,Year_of_Passing,InterestedDepartmentID,ProfessionalSummary,
LastCompany,PrimaryIndustry,PreviousNotableOrganisations,CandidateStatus,Source,SourcingDate,LastContactedDate,ResumeGoogleLink,ResumeName,addedby,createdate)
values(@Name,@gender,@Experience,@EmailID,@Phone,@Education,@Year_of_Passing,@InterestedDepartmentID,@ProfessionalSummary,@LastCompany,@PrimaryIndustry,
@PreviousNotableOrganisations,@CandidateStatus,@Source,@SourcingDate,@LastContactedDate,@ResumeGoogleLink,@ResumeName,@addedby,CURRENT_TIMESTAMP)
set @nid=IDENT_CURRENT('tblMasterCandidatePool')
end
else if(@count>0)
begin
update tblMasterCandidatePool set
Name=@Name,
Gender=@gender,
Experience=@Experience,
EmailID=@EmailID,
Phone=@Phone,
Education=@Education,
Year_of_Passing=@Year_of_Passing,
InterestedDepartmentID=@InterestedDepartmentID,
ProfessionalSummary=@ProfessionalSummary,
LastCompany=@LastCompany,
PrimaryIndustry=@PrimaryIndustry,
PreviousNotableOrganisations=@PreviousNotableOrganisations,
CandidateStatus=@CandidateStatus,
Source=@Source,
SourcingDate=@SourcingDate,
LastContactedDate=@LastContactedDate,
ResumeGoogleLink=@ResumeGoogleLink,
ResumeName=@ResumeName,
addedby=@addedby,
updatedate=CURRENT_TIMESTAMP
where CandidateID=@CandidateID
set @nid=@CandidateID
end
end


GO
/****** Object:  StoredProcedure [dbo].[proc_tblPositions]    Script Date: 18-03-2020 16:52:27 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE proc [dbo].[proc_tblPositions]
(
@PositionID int,
@DesignationID int,
@RequesterID int,
@Department int,
@Unit int,
@Priority nvarchar(15),
@TAT datetime,
@ClosedByDate datetime,
@Experience int,
@YearlySalaryBudget numeric(10,2),
@Status nvarchar(20)
)
AS
Begin
if(@PositionID=0)
Begin
insert into tblPositions (DesignationID,RequesterID,Department,Unit,Priority,TAT,RequestDate,ClosedByDate,Experience, YearlySalaryBudget, Status)
values(@DesignationID,@RequesterID,@Department,@Unit,@Priority,@TAT,CURRENT_TIMESTAMP,@ClosedByDate,@Experience,@YearlySalaryBudget,@Status)
end
else if(@PositionID>0)
Begin
update tblPositions set
DesignationID=@DesignationID,
RequesterID=@RequesterID,
Department=@Department,
Unit=@Unit,
Priority=@Priority,
TAT=@TAT,
ClosedByDate=@ClosedByDate,
Experience=@Experience,
YearlySalaryBudget=@YearlySalaryBudget,
Status=@Status
where PositionID=@PositionID
if(@Status='OnHold')
Begin
update tblPositions set Status='OnHold',updatedby=@RequesterID,Updateddate=current_timeStamp where PositionID=@PositionID

--Update Candidate Interview Status to be Position OnHold
update r set InterviewStatus=4 from tblInterviewRounds r inner join (select rounds.ApplicantID,RoundID,PositionID,Rank() over (Partition BY PositionID,rounds.CandidateID ORDER BY rounds.Createdate desc ) AS Rank from tblInterviewRounds rounds inner join tblapplicants apl on (rounds.ApplicantID=apl.ApplicantID) ) as t on(r.RoundID=t.roundid)   where positionID=@PositionID and rank=1

--Update other Candidate when position filled in Candidate Pool as Active=0
update tblMasterCandidatePool set Active=0 where active=1 and CandidateID in (select CandidateID from tblApplicants where positionID=@positionID)

--release or recycle those candidate who are approved for post and in the process of interview but didn't completed till filling positions
delete tblSuggestedApplicants where positionID=@positionID and Candidate in (select CandidateID from tblApplicants where positionID=@positionID and Stage<3) 
end
end
end


GO
/****** Object:  StoredProcedure [dbo].[proc_tblSuggestedApplicants]    Script Date: 18-03-2020 16:52:27 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE proc [dbo].[proc_tblSuggestedApplicants] --proc_tblSuggestedApplicants 1, '1,','Selected'
(
@PositionID int,
@Candidate nvarchar(500),
@CurrentStatus nvarchar(15)

)
as
begin
DECLARE @IntLocation INT,@count int,@candidateID int,@candidatelist nvarchar(200)
delete tblSuggestedApplicants where currentstatus='Selected' and PositionID=@PositionID and ','+@candidate+',' not like '%,'+candidate+',%' 
        WHILE (CHARINDEX(',',    @Candidate, 0) > 0)
        BEGIN
              SET @IntLocation =   CHARINDEX(',',    @Candidate, 0)   
			  SELECT @candidateID=RTRIM(LTRIM(SUBSTRING(@Candidate,   0, @IntLocation)))
			  Select @count=count(1) from  tblSuggestedApplicants where candidate=@candidateID and PositionID=@PositionID
			  
			  
			  if(@count=0)
			  Begin
              INSERT INTO   tblSuggestedApplicants (PositionID,Candidate,CurrentStatus,ShareDate)
			  values(@PositionID,@candidateID,@CurrentStatus,CURRENT_TIMESTAMP)
			  end
			  if(@count>0)
			  Begin
              update tblSuggestedApplicants set 
			  CurrentStatus=@CurrentStatus,ShareDate=CURRENT_TIMESTAMP
			  where PositionID=@PositionID and Candidate=@candidateID
			  end
              --LTRIM and RTRIM to ensure blank spaces are   removed
                 
              SET @Candidate = STUFF(@Candidate,   1, @IntLocation,   '') 
        END
		end


GO
/****** Object:  StoredProcedure [dbo].[Proc_tblSuggestedApplicants_Approve]    Script Date: 18-03-2020 16:52:27 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE proc [dbo].[Proc_tblSuggestedApplicants_Approve]
(
@PositionID int,
@candidateID int,
@CurrentStatus nvarchar(15)
)
as
Begin

              update tblSuggestedApplicants set 
			  CurrentStatus=@CurrentStatus,ApproveDate=CURRENT_TIMESTAMP
			  where PositionID=@PositionID and Candidate=@candidateID
			 
update tblMasterCandidatePool set Iscandidate=1 where CandidateID=@candidateID
		end


GO
/****** Object:  StoredProcedure [dbo].[Proc_tblSuggestedApplicants_reject]    Script Date: 18-03-2020 16:52:27 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE proc [dbo].[Proc_tblSuggestedApplicants_reject]
(
@PositionID int,
@candidateID int,
@CurrentStatus nvarchar(15)
)
as
Begin
Declare @count int
select @count=count(1) from tblApplicants where PositionID=@PositionID and CandidateID=@candidateID
if(@count=0) begin
              update tblSuggestedApplicants set 
			  CurrentStatus=@CurrentStatus,RejectDate=CURRENT_TIMESTAMP
			  where PositionID=@PositionID and Candidate=@candidateID
			  end

			  end


GO
/****** Object:  StoredProcedure [dbo].[proc_tblSuggestedApplicants_ReOpen]    Script Date: 18-03-2020 16:52:27 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE proc [dbo].[proc_tblSuggestedApplicants_ReOpen]
(
@PositionID int,
@ApplicantID int
)
As 
Begin
Declare @count int,@countapprove int,@CandidateID int
select @CandidateID=t.CandidateID, @count= (select count(1) from tblInterviewRounds where ApplicantID!=t.ApplicantID and candidateid=t.candidateID and SheduledOn>t.SheduledOn) from (select applicantid,CandidateID,SheduledOn,Rank() over (Partition BY Applicantid ORDER BY Createdate desc ) AS Rank from tblInterviewRounds) as t where ApplicantID=@ApplicantID and rank=1
select @countapprove=count(1) from tblSuggestedApplicants where positionid=@PositionID and candidate=@CandidateID
if(@count=0 and @countapprove=0)
Begin
INSERT INTO   tblSuggestedApplicants (PositionID,Candidate,CurrentStatus,ShareDate)
			  values(@PositionID,@CandidateID,'Approve',CURRENT_TIMESTAMP)
update tblMasterCandidatePool set active=1
end
end



GO
/****** Object:  StoredProcedure [dbo].[Proc_tblSuggestedApplicants_Select]    Script Date: 18-03-2020 16:52:27 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE proc [dbo].[Proc_tblSuggestedApplicants_Select]
(
@PositionID int,
@candidateID int
)
as
Begin
Declare @count int
select @count=count(1) from tblApplicants where PositionID=@PositionID and CandidateID=@candidateID
if(@count=0) begin
              delete tblSuggestedApplicants 
			  where PositionID=@PositionID and Candidate=@candidateID
			 end

		end


GO
/****** Object:  StoredProcedure [dbo].[proc_tblUserLogin]    Script Date: 18-03-2020 16:52:27 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
create proc [dbo].[proc_tblUserLogin]
(
@UserEmail nvarchar(500),
@UserName nvarchar(500)
)
as
Begin
Declare @count int
select @count=count(1) from tblUserLogin where userEmail=@UserEmail
if(@count=0)
begin
insert into tblUserLogin(UserName,UserEmail,Status,CreateDate)
Values(@UserName,@UserEmail,0,current_Timestamp)
end
end


GO
/****** Object:  StoredProcedure [dbo].[proc_tblUserLogin_Approve]    Script Date: 18-03-2020 16:52:27 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
create proc [dbo].[proc_tblUserLogin_Approve]
(
@UserId int,
@Role int,
@Status int
)
As
Begin
update tblUserLogin set 
Role=@Role,
Status=@Status,
ActivatedDate=CURRENT_TIMESTAMP
where UserID=@UserId
end


GO
/****** Object:  StoredProcedure [dbo].[ProcAddUpdateLink]    Script Date: 18-03-2020 16:52:27 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[ProcAddUpdateLink] 
--sp_help tblMasterLink
@LinkID	int,
@LinkTitle	nvarchar (200),
@Template	nvarchar(200),
@LinkActive	tinyint,
@DisplayOrder	int,
@Action int,
@Perfix nvarchar (50)
AS
BEGIN
	SET NOCOUNT ON;
if(@Action= '1')
begin
insert into tblMasterLink (
LinkTitle,
Template,
LinkActive,
DisplayOrder,
CreateDate, Perfix) values (
@LinkTitle,
@Template,
@LinkActive,
@DisplayOrder,
CURRENT_TIMESTAMP,
@Perfix
)
end 
if(@Action = '2')
begin 
update tblMasterLink set 
LinkTitle = @LinkTitle,
Template=@Template,
LinkActive=@LinkActive,
DisplayOrder=@DisplayOrder,
Perfix = @Perfix,
UpdateDate=CURRENT_TIMESTAMP where LinkID=@LinkID
end
END
GO
/****** Object:  Table [dbo].[tblAdminUsers]    Script Date: 18-03-2020 16:52:27 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[tblAdminUsers](
	[UserID] [int] IDENTITY(1,1) NOT NULL,
	[Name] [nvarchar](300) NULL,
	[Email] [nvarchar](100) NULL,
	[Password] [nvarchar](100) NULL,
	[LastLogin] [datetime] NULL,
	[Role] [int] NULL,
	[status] [tinyint] NULL,
	[createdate] [datetime] NULL,
	[updatedate] [datetime] NULL
) ON [PRIMARY]

GO
/****** Object:  Table [dbo].[tblApplicantComments]    Script Date: 18-03-2020 16:52:29 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[tblApplicantComments](
	[CommentID] [int] IDENTITY(1,1) NOT NULL,
	[ApplicantdID] [int] NULL,
	[PositionID] [int] NULL,
	[CommentedBy] [int] NULL,
	[Comments] [nvarchar](2000) NULL,
	[CreateDate] [datetime] NULL,
	[UpdatedDate] [datetime] NULL
) ON [PRIMARY]

GO
/****** Object:  Table [dbo].[tblApplicantRating]    Script Date: 18-03-2020 16:52:29 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[tblApplicantRating](
	[ReviewID] [int] IDENTITY(1,1) NOT NULL,
	[RoundID] [int] NULL,
	[ApplicantID] [int] NULL,
	[RatingID] [int] NULL,
	[Rating] [int] NULL,
	[createdate] [datetime] NULL,
	[addedby] [int] NULL
) ON [PRIMARY]

GO
/****** Object:  Table [dbo].[tblApplicants]    Script Date: 18-03-2020 16:52:29 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[tblApplicants](
	[ApplicantID] [int] IDENTITY(1,1) NOT NULL,
	[PositionID] [int] NULL,
	[CandidateID] [int] NULL,
	[RecruiterComments] [nvarchar](500) NULL,
	[NoticePeriodDays] [int] NULL,
	[CurrentSalary] [float] NULL,
	[ExpectedSalary] [float] NULL,
	[RaisePercentage] [float] NULL,
	[Last_Appraised_On] [nvarchar](50) NULL,
	[IsBuyout] [nvarchar](50) NULL,
	[BuyoutCost] [float] NULL,
	[Stage] [int] NULL,
	[createdate] [datetime] NULL,
	[updatedate] [datetime] NULL,
	[addedby] [int] NULL
) ON [PRIMARY]

GO
/****** Object:  Table [dbo].[tblInterviewRounds]    Script Date: 18-03-2020 16:52:29 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[tblInterviewRounds](
	[RoundID] [int] IDENTITY(1,1) NOT NULL,
	[ApplicantID] [int] NULL,
	[CandidateID] [int] NULL,
	[RoundType] [nvarchar](50) NULL,
	[Interviewer] [int] NULL,
	[SheduledOn] [datetime] NULL,
	[InterviewStatus] [int] NULL,
	[InterviewResult] [int] NULL,
	[Rating] [float] NULL,
	[createdate] [datetime] NULL,
	[updatedate] [datetime] NULL,
	[addedby] [int] NULL,
	[updatedby] [int] NULL
) ON [PRIMARY]

GO
/****** Object:  Table [dbo].[tblJobDescription]    Script Date: 18-03-2020 16:52:29 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[tblJobDescription](
	[JobID] [int] IDENTITY(1,1) NOT NULL,
	[PositionID] [int] NULL,
	[JobDescription] [nvarchar](max) NULL,
	[AddedBy] [int] NULL,
	[CreateDate] [datetime] NULL,
	[UpdatedBy] [int] NULL,
	[UpdatedDate] [datetime] NULL,
	[ApproveStatus] [int] NULL,
	[ApprovedBy] [int] NULL,
	[ApprovedDate] [datetime] NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]

GO
/****** Object:  Table [dbo].[tblMasterCandidatePool]    Script Date: 18-03-2020 16:52:29 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[tblMasterCandidatePool](
	[CandidateID] [int] IDENTITY(1,1) NOT NULL,
	[Name] [nvarchar](50) NULL,
	[Gender] [nvarchar](10) NULL,
	[Experience] [float] NULL,
	[EmailID] [nvarchar](50) NULL,
	[Phone] [nvarchar](20) NULL,
	[Education] [nvarchar](50) NULL,
	[Year_of_Passing] [nvarchar](5) NULL,
	[InterestedDepartmentID] [int] NULL,
	[ProfessionalSummary] [nvarchar](500) NULL,
	[LastCompany] [nvarchar](50) NULL,
	[PrimaryIndustry] [nvarchar](50) NULL,
	[PreviousNotableOrganisations] [nvarchar](500) NULL,
	[CandidateStatus] [nvarchar](50) NULL,
	[Source] [nvarchar](50) NULL,
	[SourcingDate] [datetime] NULL,
	[LastContactedDate] [datetime] NULL,
	[ResumeGoogleLink] [nvarchar](1000) NULL,
	[ResumeName] [nvarchar](200) NULL,
	[createdate] [datetime] NULL,
	[updatedate] [datetime] NULL,
	[addedby] [int] NULL,
	[Iscandidate] [int] NULL CONSTRAINT [DF_tblMasterCandidatePool_Iscandidate]  DEFAULT ((0)),
	[ApplicantDate] [datetime] NULL,
	[LastApplicantID] [int] NULL,
	[Active] [tinyint] NULL CONSTRAINT [DF_tblMasterCandidatePool_Active]  DEFAULT ((0))
) ON [PRIMARY]

GO
/****** Object:  Table [dbo].[tblMasterDepartment]    Script Date: 18-03-2020 16:52:29 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[tblMasterDepartment](
	[DepartmentID] [int] IDENTITY(1,1) NOT NULL,
	[DepartmentName] [nvarchar](50) NULL
) ON [PRIMARY]

GO
/****** Object:  Table [dbo].[tblMasterDesignation]    Script Date: 18-03-2020 16:52:29 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[tblMasterDesignation](
	[DesignationID] [int] IDENTITY(1,1) NOT NULL,
	[DesignationName] [nvarchar](50) NULL,
	[DepartmentID] [int] NULL
) ON [PRIMARY]

GO
/****** Object:  Table [dbo].[tblMasterHiringStatus]    Script Date: 18-03-2020 16:52:29 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[tblMasterHiringStatus](
	[HiringID] [int] IDENTITY(1,1) NOT NULL,
	[StatusName] [nvarchar](200) NULL
) ON [PRIMARY]

GO
/****** Object:  Table [dbo].[tblMasterInterviewResult]    Script Date: 18-03-2020 16:52:29 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[tblMasterInterviewResult](
	[StatusID] [int] IDENTITY(1,1) NOT NULL,
	[Result] [nvarchar](50) NULL
) ON [PRIMARY]

GO
/****** Object:  Table [dbo].[tblMasterInterviewStatus]    Script Date: 18-03-2020 16:52:29 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[tblMasterInterviewStatus](
	[InterviewStatusID] [int] IDENTITY(1,1) NOT NULL,
	[StatusName] [nvarchar](50) NULL,
	[Role] [int] NULL
) ON [PRIMARY]

GO
/****** Object:  Table [dbo].[tblMasterRating]    Script Date: 18-03-2020 16:52:29 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[tblMasterRating](
	[RatingID] [int] IDENTITY(1,1) NOT NULL,
	[RatingName] [nvarchar](50) NULL
) ON [PRIMARY]

GO
/****** Object:  Table [dbo].[tblMasterRole]    Script Date: 18-03-2020 16:52:29 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[tblMasterRole](
	[RoleID] [int] IDENTITY(1,1) NOT NULL,
	[RoleName] [nvarchar](50) NULL
) ON [PRIMARY]

GO
/****** Object:  Table [dbo].[tblMasterSource]    Script Date: 18-03-2020 16:52:29 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[tblMasterSource](
	[SourceID] [int] IDENTITY(1,1) NOT NULL,
	[SourceName] [nvarchar](100) NULL
) ON [PRIMARY]

GO
/****** Object:  Table [dbo].[tblMasterUnit]    Script Date: 18-03-2020 16:52:29 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[tblMasterUnit](
	[unitID] [int] IDENTITY(1,1) NOT NULL,
	[UnitName] [nvarchar](50) NULL
) ON [PRIMARY]

GO
/****** Object:  Table [dbo].[tblPositions]    Script Date: 18-03-2020 16:52:29 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[tblPositions](
	[PositionID] [int] IDENTITY(1,1) NOT NULL,
	[DesignationID] [int] NULL,
	[RequesterID] [int] NULL,
	[Department] [int] NULL,
	[Unit] [int] NULL,
	[Priority] [nvarchar](15) NULL,
	[TAT] [datetime] NULL,
	[RequestDate] [datetime] NULL,
	[ClosedByDate] [datetime] NULL,
	[Experience] [int] NULL,
	[YearlySalaryBudget] [float] NULL,
	[Status] [nvarchar](20) NULL,
	[JDStatus] [int] NULL CONSTRAINT [DF_tblPositions_JDStatus]  DEFAULT ((0)),
	[Closure_Date] [datetime] NULL,
	[SelectedCandidateID] [int] NULL,
	[Remark] [nvarchar](300) NULL,
	[UpdatedBy] [int] NULL,
	[UpdatedDate] [datetime] NULL
) ON [PRIMARY]

GO
/****** Object:  Table [dbo].[tblSuggestedApplicants]    Script Date: 18-03-2020 16:52:29 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[tblSuggestedApplicants](
	[SelectionID] [int] IDENTITY(1,1) NOT NULL,
	[PositionID] [int] NULL,
	[Candidate] [nvarchar](5) NULL,
	[CurrentStatus] [nvarchar](15) NULL,
	[ShareDate] [datetime] NULL,
	[ApproveDate] [datetime] NULL,
	[RejectDate] [datetime] NULL
) ON [PRIMARY]

GO
/****** Object:  Table [dbo].[tblUserLogin]    Script Date: 18-03-2020 16:52:29 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[tblUserLogin](
	[UserID] [int] IDENTITY(1,1) NOT NULL,
	[UserEmail] [nvarchar](50) NULL,
	[UserName] [nvarchar](50) NULL,
	[LastLoginDate] [datetime] NULL,
	[Createdate] [datetime] NULL,
	[Status] [tinyint] NULL,
	[Role] [int] NULL,
	[ActivatedDate] [datetime] NULL
) ON [PRIMARY]

GO
/****** Object:  View [dbo].[vwCandidatepool]    Script Date: 18-03-2020 16:52:29 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE VIEW [dbo].[vwCandidatepool]
AS
SELECT DISTINCT 
                         t.CandidateID, t.Name, t.Experience, t.EmailID, t.CandidateStatus, t.Source, t.Gender, t.ResumeName, t.ResumeGoogleLink, t.LastContactedDate, t.Education, t.LastApplicantID, t1.DepartmentName, t.Phone, t.Year_of_Passing, 
                         t.ProfessionalSummary, t.InterestedDepartmentID, t.LastCompany, t.PrimaryIndustry, t.PreviousNotableOrganisations, t.SourcingDate, t.createdate, t.updatedate, t.addedby, t.Iscandidate, t.ApplicantDate, t.Active
FROM            dbo.tblMasterCandidatePool AS t INNER JOIN
                         dbo.tblMasterDepartment AS t1 ON t.InterestedDepartmentID = t1.DepartmentID
WHERE        (t.Active <> 1) OR
                         (t.Active <> 2) OR
                         (t.Active IS NULL)



GO
/****** Object:  View [dbo].[vwPosition]    Script Date: 18-03-2020 16:52:29 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO


Create View [dbo].[vwPosition]
as

select pos.*,dpt.DepartmentName,desg.DesignationName,unit.UnitName from tblPositions pos inner join tblMasterDepartment dpt on (pos.Department=dpt.DepartmentID) 
inner join tblMasterDesignation desg on (pos.DesignationID=desg.DesignationID) inner join tblMasterUnit unit on (pos.Unit=unit.unitID)






GO
/****** Object:  View [dbo].[vwtblApplicants]    Script Date: 18-03-2020 16:52:29 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO



CREATE View [dbo].[vwtblApplicants]
as

select sa.ApplicantID,sa.Stage,Sa.PositionID, pos.RequesterID,pos.Unit,unit.UnitName,pos.priority,pos.TAT,pos.experience as ReuiredExperience,pos.JDstatus,dpt.DepartmentName,desg.DesignationName,cand.* 
,(select username from tblUserLogin where UserID=pos.RequesterID and Status=1 and role is not null) as RequesterName

 from tblApplicants sa
inner join tblMasterCandidatePool cand on (sa.CandidateID=cand.CandidateID)
inner join tblPositions pos on (sa.PositionID=pos.PositionID)
inner join tblMasterDepartment dpt on (pos.Department=dpt.DepartmentID) 
inner join tblMasterDesignation desg on (pos.DesignationID=desg.DesignationID)
inner join tblMasterUnit unit on (pos.unit=unit.unitID)









GO
/****** Object:  View [dbo].[vwtblSuggestedApplicants]    Script Date: 18-03-2020 16:52:29 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO


CREATE View [dbo].[vwtblSuggestedApplicants]
as

select pos.RequesterID,(select username from tblUserLogin where UserID=pos.RequesterID and Status=1 and role is not null) as RequesterName,pos.Unit,pos.priority,pos.TAT,pos.experience as ReuiredExperience,pos.JDstatus,dpt.DepartmentName,desg.DesignationName,cand.* from tblSuggestedApplicants sa
inner join tblMasterCandidatePool cand on (sa.Candidate=cand.CandidateID)
inner join tblPositions pos on (sa.PositionID=pos.PositionID)
inner join tblMasterDepartment dpt on (pos.Department=dpt.DepartmentID) 
inner join tblMasterDesignation desg on (pos.DesignationID=desg.DesignationID)








GO
SET IDENTITY_INSERT [dbo].[tblAdminUsers] ON 

INSERT [dbo].[tblAdminUsers] ([UserID], [Name], [Email], [Password], [LastLogin], [Role], [status], [createdate], [updatedate]) VALUES (1, N'Admin', N'admin@envigo.co.uk', N'oeTrh7roejtR9aXN1zwg9w==', NULL, 1, 1, CAST(N'2017-10-13 18:14:55.637' AS DateTime), NULL)
INSERT [dbo].[tblAdminUsers] ([UserID], [Name], [Email], [Password], [LastLogin], [Role], [status], [createdate], [updatedate]) VALUES (2, N'Vivek Gupta', N'vivek@envigo.co.uk', N'7bfq5bURZgo=', NULL, 2, 1, CAST(N'2017-10-13 18:14:55.637' AS DateTime), NULL)
SET IDENTITY_INSERT [dbo].[tblAdminUsers] OFF
SET IDENTITY_INSERT [dbo].[tblApplicantComments] ON 

INSERT [dbo].[tblApplicantComments] ([CommentID], [ApplicantdID], [PositionID], [CommentedBy], [Comments], [CreateDate], [UpdatedDate]) VALUES (1, 1, 0, 5, N'&lt;p&gt;Good Performance&lt;/p&gt;', CAST(N'2019-09-02 17:48:49.780' AS DateTime), NULL)
INSERT [dbo].[tblApplicantComments] ([CommentID], [ApplicantdID], [PositionID], [CommentedBy], [Comments], [CreateDate], [UpdatedDate]) VALUES (2, 1, 0, 5, N'&lt;p&gt;Nice performance&lt;/p&gt;', CAST(N'2019-09-02 17:49:50.050' AS DateTime), NULL)
SET IDENTITY_INSERT [dbo].[tblApplicantComments] OFF
SET IDENTITY_INSERT [dbo].[tblApplicantRating] ON 

INSERT [dbo].[tblApplicantRating] ([ReviewID], [RoundID], [ApplicantID], [RatingID], [Rating], [createdate], [addedby]) VALUES (1, 1, 1, 1, 3, CAST(N'2019-08-22 17:51:33.000' AS DateTime), 5)
INSERT [dbo].[tblApplicantRating] ([ReviewID], [RoundID], [ApplicantID], [RatingID], [Rating], [createdate], [addedby]) VALUES (2, 1, 1, 2, 5, CAST(N'2019-08-22 17:51:33.733' AS DateTime), 5)
INSERT [dbo].[tblApplicantRating] ([ReviewID], [RoundID], [ApplicantID], [RatingID], [Rating], [createdate], [addedby]) VALUES (3, 1, 1, 3, 1, CAST(N'2019-08-22 17:51:33.733' AS DateTime), 5)
INSERT [dbo].[tblApplicantRating] ([ReviewID], [RoundID], [ApplicantID], [RatingID], [Rating], [createdate], [addedby]) VALUES (4, 1, 1, 4, 1, CAST(N'2019-08-22 17:51:33.733' AS DateTime), 5)
INSERT [dbo].[tblApplicantRating] ([ReviewID], [RoundID], [ApplicantID], [RatingID], [Rating], [createdate], [addedby]) VALUES (5, 1, 1, 5, 1, CAST(N'2019-08-22 17:51:33.733' AS DateTime), 5)
INSERT [dbo].[tblApplicantRating] ([ReviewID], [RoundID], [ApplicantID], [RatingID], [Rating], [createdate], [addedby]) VALUES (6, 7, 3, 1, 3, CAST(N'2019-08-23 17:43:47.240' AS DateTime), 5)
INSERT [dbo].[tblApplicantRating] ([ReviewID], [RoundID], [ApplicantID], [RatingID], [Rating], [createdate], [addedby]) VALUES (7, 7, 3, 2, 4, CAST(N'2019-08-23 17:43:47.270' AS DateTime), 5)
INSERT [dbo].[tblApplicantRating] ([ReviewID], [RoundID], [ApplicantID], [RatingID], [Rating], [createdate], [addedby]) VALUES (8, 7, 3, 3, 5, CAST(N'2019-08-23 17:43:47.270' AS DateTime), 5)
INSERT [dbo].[tblApplicantRating] ([ReviewID], [RoundID], [ApplicantID], [RatingID], [Rating], [createdate], [addedby]) VALUES (11, 1009, 5, 1, 2, CAST(N'2019-08-30 16:49:55.120' AS DateTime), 5)
INSERT [dbo].[tblApplicantRating] ([ReviewID], [RoundID], [ApplicantID], [RatingID], [Rating], [createdate], [addedby]) VALUES (12, 1009, 5, 2, 5, CAST(N'2019-08-30 16:49:55.120' AS DateTime), 5)
INSERT [dbo].[tblApplicantRating] ([ReviewID], [RoundID], [ApplicantID], [RatingID], [Rating], [createdate], [addedby]) VALUES (13, 1009, 5, 3, 5, CAST(N'2019-08-30 16:49:55.123' AS DateTime), 5)
INSERT [dbo].[tblApplicantRating] ([ReviewID], [RoundID], [ApplicantID], [RatingID], [Rating], [createdate], [addedby]) VALUES (14, 1009, 5, 4, 5, CAST(N'2019-08-30 16:49:55.123' AS DateTime), 5)
INSERT [dbo].[tblApplicantRating] ([ReviewID], [RoundID], [ApplicantID], [RatingID], [Rating], [createdate], [addedby]) VALUES (15, 1009, 5, 5, 4, CAST(N'2019-08-30 16:49:55.123' AS DateTime), 5)
INSERT [dbo].[tblApplicantRating] ([ReviewID], [RoundID], [ApplicantID], [RatingID], [Rating], [createdate], [addedby]) VALUES (16, 1008, 4, 1, 3, CAST(N'2019-08-30 16:50:15.210' AS DateTime), 5)
INSERT [dbo].[tblApplicantRating] ([ReviewID], [RoundID], [ApplicantID], [RatingID], [Rating], [createdate], [addedby]) VALUES (17, 1008, 4, 2, 3, CAST(N'2019-08-30 16:50:15.210' AS DateTime), 5)
INSERT [dbo].[tblApplicantRating] ([ReviewID], [RoundID], [ApplicantID], [RatingID], [Rating], [createdate], [addedby]) VALUES (18, 1008, 4, 3, 5, CAST(N'2019-08-30 16:50:15.210' AS DateTime), 5)
INSERT [dbo].[tblApplicantRating] ([ReviewID], [RoundID], [ApplicantID], [RatingID], [Rating], [createdate], [addedby]) VALUES (19, 1008, 4, 4, 5, CAST(N'2019-08-30 16:50:15.210' AS DateTime), 5)
INSERT [dbo].[tblApplicantRating] ([ReviewID], [RoundID], [ApplicantID], [RatingID], [Rating], [createdate], [addedby]) VALUES (20, 1008, 4, 5, 3, CAST(N'2019-08-30 16:50:15.210' AS DateTime), 5)
INSERT [dbo].[tblApplicantRating] ([ReviewID], [RoundID], [ApplicantID], [RatingID], [Rating], [createdate], [addedby]) VALUES (21, 1012, 2, 1, 3, CAST(N'2019-09-02 11:28:09.230' AS DateTime), 5)
INSERT [dbo].[tblApplicantRating] ([ReviewID], [RoundID], [ApplicantID], [RatingID], [Rating], [createdate], [addedby]) VALUES (22, 1012, 2, 2, 4, CAST(N'2019-09-02 11:28:09.233' AS DateTime), 5)
INSERT [dbo].[tblApplicantRating] ([ReviewID], [RoundID], [ApplicantID], [RatingID], [Rating], [createdate], [addedby]) VALUES (23, 1012, 2, 3, 3, CAST(N'2019-09-02 11:28:09.233' AS DateTime), 5)
INSERT [dbo].[tblApplicantRating] ([ReviewID], [RoundID], [ApplicantID], [RatingID], [Rating], [createdate], [addedby]) VALUES (24, 1012, 2, 4, 3, CAST(N'2019-09-02 11:28:09.233' AS DateTime), 5)
INSERT [dbo].[tblApplicantRating] ([ReviewID], [RoundID], [ApplicantID], [RatingID], [Rating], [createdate], [addedby]) VALUES (25, 1012, 2, 5, 3, CAST(N'2019-09-02 11:28:09.233' AS DateTime), 5)
INSERT [dbo].[tblApplicantRating] ([ReviewID], [RoundID], [ApplicantID], [RatingID], [Rating], [createdate], [addedby]) VALUES (26, 1015, 8, 1, 3, CAST(N'2019-09-03 10:59:42.580' AS DateTime), 5)
INSERT [dbo].[tblApplicantRating] ([ReviewID], [RoundID], [ApplicantID], [RatingID], [Rating], [createdate], [addedby]) VALUES (27, 1015, 8, 2, 3, CAST(N'2019-09-03 10:59:42.580' AS DateTime), 5)
INSERT [dbo].[tblApplicantRating] ([ReviewID], [RoundID], [ApplicantID], [RatingID], [Rating], [createdate], [addedby]) VALUES (28, 1015, 8, 3, 4, CAST(N'2019-09-03 10:59:42.583' AS DateTime), 5)
INSERT [dbo].[tblApplicantRating] ([ReviewID], [RoundID], [ApplicantID], [RatingID], [Rating], [createdate], [addedby]) VALUES (29, 1015, 8, 4, 4, CAST(N'2019-09-03 10:59:42.583' AS DateTime), 5)
INSERT [dbo].[tblApplicantRating] ([ReviewID], [RoundID], [ApplicantID], [RatingID], [Rating], [createdate], [addedby]) VALUES (30, 1015, 8, 5, 4, CAST(N'2019-09-03 10:59:42.583' AS DateTime), 5)
INSERT [dbo].[tblApplicantRating] ([ReviewID], [RoundID], [ApplicantID], [RatingID], [Rating], [createdate], [addedby]) VALUES (31, 1018, 9, 1, 2, CAST(N'2019-09-03 11:33:05.123' AS DateTime), 5)
INSERT [dbo].[tblApplicantRating] ([ReviewID], [RoundID], [ApplicantID], [RatingID], [Rating], [createdate], [addedby]) VALUES (32, 1018, 9, 2, 4, CAST(N'2019-09-03 11:33:05.127' AS DateTime), 5)
INSERT [dbo].[tblApplicantRating] ([ReviewID], [RoundID], [ApplicantID], [RatingID], [Rating], [createdate], [addedby]) VALUES (33, 1018, 9, 3, 4, CAST(N'2019-09-03 11:33:05.127' AS DateTime), 5)
INSERT [dbo].[tblApplicantRating] ([ReviewID], [RoundID], [ApplicantID], [RatingID], [Rating], [createdate], [addedby]) VALUES (34, 1018, 9, 4, 4, CAST(N'2019-09-03 11:33:05.127' AS DateTime), 5)
INSERT [dbo].[tblApplicantRating] ([ReviewID], [RoundID], [ApplicantID], [RatingID], [Rating], [createdate], [addedby]) VALUES (35, 1018, 9, 5, 5, CAST(N'2019-09-03 11:33:05.127' AS DateTime), 5)
INSERT [dbo].[tblApplicantRating] ([ReviewID], [RoundID], [ApplicantID], [RatingID], [Rating], [createdate], [addedby]) VALUES (36, 1019, 9, 1, 4, CAST(N'2019-09-03 11:34:06.893' AS DateTime), 5)
INSERT [dbo].[tblApplicantRating] ([ReviewID], [RoundID], [ApplicantID], [RatingID], [Rating], [createdate], [addedby]) VALUES (37, 1019, 9, 2, 5, CAST(N'2019-09-03 11:34:06.893' AS DateTime), 5)
INSERT [dbo].[tblApplicantRating] ([ReviewID], [RoundID], [ApplicantID], [RatingID], [Rating], [createdate], [addedby]) VALUES (38, 1019, 9, 3, 5, CAST(N'2019-09-03 11:34:06.893' AS DateTime), 5)
INSERT [dbo].[tblApplicantRating] ([ReviewID], [RoundID], [ApplicantID], [RatingID], [Rating], [createdate], [addedby]) VALUES (39, 1019, 9, 4, 5, CAST(N'2019-09-03 11:34:06.893' AS DateTime), 5)
INSERT [dbo].[tblApplicantRating] ([ReviewID], [RoundID], [ApplicantID], [RatingID], [Rating], [createdate], [addedby]) VALUES (40, 1019, 9, 5, 5, CAST(N'2019-09-03 11:34:06.893' AS DateTime), 5)
INSERT [dbo].[tblApplicantRating] ([ReviewID], [RoundID], [ApplicantID], [RatingID], [Rating], [createdate], [addedby]) VALUES (61, 1028, 13, 1, 3, CAST(N'2019-09-04 15:03:03.017' AS DateTime), 5)
INSERT [dbo].[tblApplicantRating] ([ReviewID], [RoundID], [ApplicantID], [RatingID], [Rating], [createdate], [addedby]) VALUES (62, 1028, 13, 2, 4, CAST(N'2019-09-04 15:03:03.017' AS DateTime), 5)
INSERT [dbo].[tblApplicantRating] ([ReviewID], [RoundID], [ApplicantID], [RatingID], [Rating], [createdate], [addedby]) VALUES (63, 1028, 13, 3, 5, CAST(N'2019-09-04 15:03:03.017' AS DateTime), 5)
INSERT [dbo].[tblApplicantRating] ([ReviewID], [RoundID], [ApplicantID], [RatingID], [Rating], [createdate], [addedby]) VALUES (64, 1028, 13, 4, 5, CAST(N'2019-09-04 15:03:03.017' AS DateTime), 5)
INSERT [dbo].[tblApplicantRating] ([ReviewID], [RoundID], [ApplicantID], [RatingID], [Rating], [createdate], [addedby]) VALUES (65, 1028, 13, 5, 5, CAST(N'2019-09-04 15:03:03.020' AS DateTime), 5)
INSERT [dbo].[tblApplicantRating] ([ReviewID], [RoundID], [ApplicantID], [RatingID], [Rating], [createdate], [addedby]) VALUES (66, 1029, 14, 1, 3, CAST(N'2019-09-04 15:52:09.317' AS DateTime), 5)
INSERT [dbo].[tblApplicantRating] ([ReviewID], [RoundID], [ApplicantID], [RatingID], [Rating], [createdate], [addedby]) VALUES (67, 1029, 14, 2, 4, CAST(N'2019-09-04 15:52:09.317' AS DateTime), 5)
INSERT [dbo].[tblApplicantRating] ([ReviewID], [RoundID], [ApplicantID], [RatingID], [Rating], [createdate], [addedby]) VALUES (9, 7, 3, 4, 5, CAST(N'2019-08-23 17:43:47.270' AS DateTime), 5)
INSERT [dbo].[tblApplicantRating] ([ReviewID], [RoundID], [ApplicantID], [RatingID], [Rating], [createdate], [addedby]) VALUES (10, 7, 3, 5, 3, CAST(N'2019-08-23 17:43:47.353' AS DateTime), 5)
INSERT [dbo].[tblApplicantRating] ([ReviewID], [RoundID], [ApplicantID], [RatingID], [Rating], [createdate], [addedby]) VALUES (41, 1021, 11, 1, 2, CAST(N'2019-09-03 15:01:51.813' AS DateTime), 5)
INSERT [dbo].[tblApplicantRating] ([ReviewID], [RoundID], [ApplicantID], [RatingID], [Rating], [createdate], [addedby]) VALUES (42, 1021, 11, 2, 4, CAST(N'2019-09-03 15:01:51.817' AS DateTime), 5)
INSERT [dbo].[tblApplicantRating] ([ReviewID], [RoundID], [ApplicantID], [RatingID], [Rating], [createdate], [addedby]) VALUES (43, 1021, 11, 3, 5, CAST(N'2019-09-03 15:01:51.817' AS DateTime), 5)
INSERT [dbo].[tblApplicantRating] ([ReviewID], [RoundID], [ApplicantID], [RatingID], [Rating], [createdate], [addedby]) VALUES (44, 1021, 11, 4, 5, CAST(N'2019-09-03 15:01:51.817' AS DateTime), 5)
INSERT [dbo].[tblApplicantRating] ([ReviewID], [RoundID], [ApplicantID], [RatingID], [Rating], [createdate], [addedby]) VALUES (45, 1021, 11, 5, 5, CAST(N'2019-09-03 15:01:51.817' AS DateTime), 5)
INSERT [dbo].[tblApplicantRating] ([ReviewID], [RoundID], [ApplicantID], [RatingID], [Rating], [createdate], [addedby]) VALUES (46, 1022, 11, 1, 4, CAST(N'2019-09-03 15:03:35.820' AS DateTime), 5)
INSERT [dbo].[tblApplicantRating] ([ReviewID], [RoundID], [ApplicantID], [RatingID], [Rating], [createdate], [addedby]) VALUES (47, 1022, 11, 2, 3, CAST(N'2019-09-03 15:03:35.820' AS DateTime), 5)
INSERT [dbo].[tblApplicantRating] ([ReviewID], [RoundID], [ApplicantID], [RatingID], [Rating], [createdate], [addedby]) VALUES (48, 1022, 11, 3, 5, CAST(N'2019-09-03 15:03:35.827' AS DateTime), 5)
INSERT [dbo].[tblApplicantRating] ([ReviewID], [RoundID], [ApplicantID], [RatingID], [Rating], [createdate], [addedby]) VALUES (49, 1022, 11, 4, 5, CAST(N'2019-09-03 15:03:35.830' AS DateTime), 5)
INSERT [dbo].[tblApplicantRating] ([ReviewID], [RoundID], [ApplicantID], [RatingID], [Rating], [createdate], [addedby]) VALUES (50, 1022, 11, 5, 4, CAST(N'2019-09-03 15:03:35.830' AS DateTime), 5)
INSERT [dbo].[tblApplicantRating] ([ReviewID], [RoundID], [ApplicantID], [RatingID], [Rating], [createdate], [addedby]) VALUES (51, 1023, 3, 1, 3, CAST(N'2019-09-03 15:04:43.367' AS DateTime), 5)
INSERT [dbo].[tblApplicantRating] ([ReviewID], [RoundID], [ApplicantID], [RatingID], [Rating], [createdate], [addedby]) VALUES (52, 1023, 3, 2, 5, CAST(N'2019-09-03 15:04:43.367' AS DateTime), 5)
INSERT [dbo].[tblApplicantRating] ([ReviewID], [RoundID], [ApplicantID], [RatingID], [Rating], [createdate], [addedby]) VALUES (53, 1023, 3, 3, 4, CAST(N'2019-09-03 15:04:43.367' AS DateTime), 5)
INSERT [dbo].[tblApplicantRating] ([ReviewID], [RoundID], [ApplicantID], [RatingID], [Rating], [createdate], [addedby]) VALUES (54, 1023, 3, 4, 4, CAST(N'2019-09-03 15:04:43.367' AS DateTime), 5)
INSERT [dbo].[tblApplicantRating] ([ReviewID], [RoundID], [ApplicantID], [RatingID], [Rating], [createdate], [addedby]) VALUES (55, 1023, 3, 5, 5, CAST(N'2019-09-03 15:04:43.370' AS DateTime), 5)
INSERT [dbo].[tblApplicantRating] ([ReviewID], [RoundID], [ApplicantID], [RatingID], [Rating], [createdate], [addedby]) VALUES (56, 1016, 7, 1, 4, CAST(N'2019-09-03 15:41:12.390' AS DateTime), 5)
INSERT [dbo].[tblApplicantRating] ([ReviewID], [RoundID], [ApplicantID], [RatingID], [Rating], [createdate], [addedby]) VALUES (57, 1016, 7, 2, 4, CAST(N'2019-09-03 15:41:12.390' AS DateTime), 5)
INSERT [dbo].[tblApplicantRating] ([ReviewID], [RoundID], [ApplicantID], [RatingID], [Rating], [createdate], [addedby]) VALUES (58, 1016, 7, 3, 5, CAST(N'2019-09-03 15:41:12.390' AS DateTime), 5)
INSERT [dbo].[tblApplicantRating] ([ReviewID], [RoundID], [ApplicantID], [RatingID], [Rating], [createdate], [addedby]) VALUES (59, 1016, 7, 4, 5, CAST(N'2019-09-03 15:41:12.390' AS DateTime), 5)
INSERT [dbo].[tblApplicantRating] ([ReviewID], [RoundID], [ApplicantID], [RatingID], [Rating], [createdate], [addedby]) VALUES (60, 1016, 7, 5, 5, CAST(N'2019-09-03 15:41:12.390' AS DateTime), 5)
INSERT [dbo].[tblApplicantRating] ([ReviewID], [RoundID], [ApplicantID], [RatingID], [Rating], [createdate], [addedby]) VALUES (68, 1029, 14, 3, 5, CAST(N'2019-09-04 15:52:09.317' AS DateTime), 5)
INSERT [dbo].[tblApplicantRating] ([ReviewID], [RoundID], [ApplicantID], [RatingID], [Rating], [createdate], [addedby]) VALUES (69, 1029, 14, 4, 5, CAST(N'2019-09-04 15:52:09.343' AS DateTime), 5)
INSERT [dbo].[tblApplicantRating] ([ReviewID], [RoundID], [ApplicantID], [RatingID], [Rating], [createdate], [addedby]) VALUES (70, 1029, 14, 5, 5, CAST(N'2019-09-04 15:52:09.343' AS DateTime), 5)
INSERT [dbo].[tblApplicantRating] ([ReviewID], [RoundID], [ApplicantID], [RatingID], [Rating], [createdate], [addedby]) VALUES (71, 1030, 15, 1, 5, CAST(N'2019-09-04 15:52:28.937' AS DateTime), 5)
INSERT [dbo].[tblApplicantRating] ([ReviewID], [RoundID], [ApplicantID], [RatingID], [Rating], [createdate], [addedby]) VALUES (72, 1030, 15, 2, 5, CAST(N'2019-09-04 15:52:28.940' AS DateTime), 5)
INSERT [dbo].[tblApplicantRating] ([ReviewID], [RoundID], [ApplicantID], [RatingID], [Rating], [createdate], [addedby]) VALUES (73, 1030, 15, 3, 4, CAST(N'2019-09-04 15:52:28.940' AS DateTime), 5)
INSERT [dbo].[tblApplicantRating] ([ReviewID], [RoundID], [ApplicantID], [RatingID], [Rating], [createdate], [addedby]) VALUES (74, 1030, 15, 4, 4, CAST(N'2019-09-04 15:52:28.940' AS DateTime), 5)
INSERT [dbo].[tblApplicantRating] ([ReviewID], [RoundID], [ApplicantID], [RatingID], [Rating], [createdate], [addedby]) VALUES (75, 1030, 15, 5, 5, CAST(N'2019-09-04 15:52:28.943' AS DateTime), 5)
INSERT [dbo].[tblApplicantRating] ([ReviewID], [RoundID], [ApplicantID], [RatingID], [Rating], [createdate], [addedby]) VALUES (76, 1031, 15, 1, 5, CAST(N'2019-09-04 15:54:59.843' AS DateTime), 5)
INSERT [dbo].[tblApplicantRating] ([ReviewID], [RoundID], [ApplicantID], [RatingID], [Rating], [createdate], [addedby]) VALUES (77, 1031, 15, 2, 4, CAST(N'2019-09-04 15:54:59.843' AS DateTime), 5)
INSERT [dbo].[tblApplicantRating] ([ReviewID], [RoundID], [ApplicantID], [RatingID], [Rating], [createdate], [addedby]) VALUES (78, 1031, 15, 3, 4, CAST(N'2019-09-04 15:54:59.843' AS DateTime), 5)
INSERT [dbo].[tblApplicantRating] ([ReviewID], [RoundID], [ApplicantID], [RatingID], [Rating], [createdate], [addedby]) VALUES (79, 1031, 15, 4, 4, CAST(N'2019-09-04 15:54:59.843' AS DateTime), 5)
INSERT [dbo].[tblApplicantRating] ([ReviewID], [RoundID], [ApplicantID], [RatingID], [Rating], [createdate], [addedby]) VALUES (80, 1031, 15, 5, 4, CAST(N'2019-09-04 15:54:59.843' AS DateTime), 5)
INSERT [dbo].[tblApplicantRating] ([ReviewID], [RoundID], [ApplicantID], [RatingID], [Rating], [createdate], [addedby]) VALUES (81, 1032, 16, 1, 4, CAST(N'2019-09-04 15:56:17.297' AS DateTime), 5)
INSERT [dbo].[tblApplicantRating] ([ReviewID], [RoundID], [ApplicantID], [RatingID], [Rating], [createdate], [addedby]) VALUES (82, 1032, 16, 2, 5, CAST(N'2019-09-04 15:56:17.297' AS DateTime), 5)
INSERT [dbo].[tblApplicantRating] ([ReviewID], [RoundID], [ApplicantID], [RatingID], [Rating], [createdate], [addedby]) VALUES (83, 1032, 16, 3, 4, CAST(N'2019-09-04 15:56:17.297' AS DateTime), 5)
INSERT [dbo].[tblApplicantRating] ([ReviewID], [RoundID], [ApplicantID], [RatingID], [Rating], [createdate], [addedby]) VALUES (84, 1032, 16, 4, 4, CAST(N'2019-09-04 15:56:17.297' AS DateTime), 5)
INSERT [dbo].[tblApplicantRating] ([ReviewID], [RoundID], [ApplicantID], [RatingID], [Rating], [createdate], [addedby]) VALUES (85, 1032, 16, 5, 5, CAST(N'2019-09-04 15:56:17.300' AS DateTime), 5)
SET IDENTITY_INSERT [dbo].[tblApplicantRating] OFF
SET IDENTITY_INSERT [dbo].[tblApplicants] ON 

INSERT [dbo].[tblApplicants] ([ApplicantID], [PositionID], [CandidateID], [RecruiterComments], [NoticePeriodDays], [CurrentSalary], [ExpectedSalary], [RaisePercentage], [Last_Appraised_On], [IsBuyout], [BuyoutCost], [Stage], [createdate], [updatedate], [addedby]) VALUES (1, 1, 2, NULL, 30, 1.5, 2, 33.333333333333343, N'Jan-2019', N'Not Sure', 0, 2, CAST(N'2019-08-22 17:44:24.387' AS DateTime), NULL, 4)
INSERT [dbo].[tblApplicants] ([ApplicantID], [PositionID], [CandidateID], [RecruiterComments], [NoticePeriodDays], [CurrentSalary], [ExpectedSalary], [RaisePercentage], [Last_Appraised_On], [IsBuyout], [BuyoutCost], [Stage], [createdate], [updatedate], [addedby]) VALUES (2, 1, 3, NULL, 60, 2, 2.5, 25, N'Aug-2019', N'Not Sure', 0, 2, CAST(N'2019-08-22 17:46:35.050' AS DateTime), NULL, 4)
INSERT [dbo].[tblApplicants] ([ApplicantID], [PositionID], [CandidateID], [RecruiterComments], [NoticePeriodDays], [CurrentSalary], [ExpectedSalary], [RaisePercentage], [Last_Appraised_On], [IsBuyout], [BuyoutCost], [Stage], [createdate], [updatedate], [addedby]) VALUES (3, 2, 2, NULL, 30, 1.5, 2, 33.333333333333343, N'Jan-2019', N'Not Sure', 0, 4, CAST(N'2019-08-23 15:59:59.880' AS DateTime), CAST(N'2019-09-03 15:31:38.483' AS DateTime), 5)
INSERT [dbo].[tblApplicants] ([ApplicantID], [PositionID], [CandidateID], [RecruiterComments], [NoticePeriodDays], [CurrentSalary], [ExpectedSalary], [RaisePercentage], [Last_Appraised_On], [IsBuyout], [BuyoutCost], [Stage], [createdate], [updatedate], [addedby]) VALUES (4, 3, 1, NULL, 30, 5.2, 7, 34.615384615384613, N'Apr-2019', N'Not Sure', 0, 2, CAST(N'2019-08-30 16:48:18.470' AS DateTime), NULL, 5)
INSERT [dbo].[tblApplicants] ([ApplicantID], [PositionID], [CandidateID], [RecruiterComments], [NoticePeriodDays], [CurrentSalary], [ExpectedSalary], [RaisePercentage], [Last_Appraised_On], [IsBuyout], [BuyoutCost], [Stage], [createdate], [updatedate], [addedby]) VALUES (10, 2, 1, NULL, 30, 5.2, 7, 34.615384615384613, N'Apr-2019', N'Not Sure', 0, 1, CAST(N'2019-09-03 12:49:00.020' AS DateTime), NULL, 5)
INSERT [dbo].[tblApplicants] ([ApplicantID], [PositionID], [CandidateID], [RecruiterComments], [NoticePeriodDays], [CurrentSalary], [ExpectedSalary], [RaisePercentage], [Last_Appraised_On], [IsBuyout], [BuyoutCost], [Stage], [createdate], [updatedate], [addedby]) VALUES (6, 3, 5, NULL, 40, 6, 9, 50, N'Aug-2019', NULL, 0, 1, CAST(N'2019-08-30 16:49:11.953' AS DateTime), NULL, 5)
INSERT [dbo].[tblApplicants] ([ApplicantID], [PositionID], [CandidateID], [RecruiterComments], [NoticePeriodDays], [CurrentSalary], [ExpectedSalary], [RaisePercentage], [Last_Appraised_On], [IsBuyout], [BuyoutCost], [Stage], [createdate], [updatedate], [addedby]) VALUES (7, 1, 4, NULL, 30, 5, 7, 40, N'Aug-2019', NULL, 0, 2, CAST(N'2019-09-02 11:37:46.800' AS DateTime), NULL, 5)
INSERT [dbo].[tblApplicants] ([ApplicantID], [PositionID], [CandidateID], [RecruiterComments], [NoticePeriodDays], [CurrentSalary], [ExpectedSalary], [RaisePercentage], [Last_Appraised_On], [IsBuyout], [BuyoutCost], [Stage], [createdate], [updatedate], [addedby]) VALUES (12, 4, 8, NULL, 30, 5, 6, 20, N'Aug-2019', NULL, 0, 2, CAST(N'2019-09-04 14:27:48.753' AS DateTime), CAST(N'2019-09-04 15:00:33.043' AS DateTime), 5)
INSERT [dbo].[tblApplicants] ([ApplicantID], [PositionID], [CandidateID], [RecruiterComments], [NoticePeriodDays], [CurrentSalary], [ExpectedSalary], [RaisePercentage], [Last_Appraised_On], [IsBuyout], [BuyoutCost], [Stage], [createdate], [updatedate], [addedby]) VALUES (9, 3, 6, NULL, 30, 5, 6, 20, N'Apr-2019', NULL, 0, NULL, CAST(N'2019-09-03 11:27:20.310' AS DateTime), CAST(N'2019-09-03 11:35:34.577' AS DateTime), 5)
INSERT [dbo].[tblApplicants] ([ApplicantID], [PositionID], [CandidateID], [RecruiterComments], [NoticePeriodDays], [CurrentSalary], [ExpectedSalary], [RaisePercentage], [Last_Appraised_On], [IsBuyout], [BuyoutCost], [Stage], [createdate], [updatedate], [addedby]) VALUES (14, 5, 7, NULL, 0, 4, 6, 50, N'Aug-2019', NULL, 0, 2, CAST(N'2019-09-04 15:50:39.200' AS DateTime), NULL, 5)
INSERT [dbo].[tblApplicants] ([ApplicantID], [PositionID], [CandidateID], [RecruiterComments], [NoticePeriodDays], [CurrentSalary], [ExpectedSalary], [RaisePercentage], [Last_Appraised_On], [IsBuyout], [BuyoutCost], [Stage], [createdate], [updatedate], [addedby]) VALUES (15, 5, 4, NULL, 30, 5, 7, 40, N'Aug-2019', NULL, 0, 2, CAST(N'2019-09-04 15:51:37.233' AS DateTime), NULL, 5)
INSERT [dbo].[tblApplicants] ([ApplicantID], [PositionID], [CandidateID], [RecruiterComments], [NoticePeriodDays], [CurrentSalary], [ExpectedSalary], [RaisePercentage], [Last_Appraised_On], [IsBuyout], [BuyoutCost], [Stage], [createdate], [updatedate], [addedby]) VALUES (16, 5, 9, NULL, 0, 5, 8, 60, N'Feb-2019', NULL, 0, 2, CAST(N'2019-09-04 15:55:48.373' AS DateTime), NULL, 5)
INSERT [dbo].[tblApplicants] ([ApplicantID], [PositionID], [CandidateID], [RecruiterComments], [NoticePeriodDays], [CurrentSalary], [ExpectedSalary], [RaisePercentage], [Last_Appraised_On], [IsBuyout], [BuyoutCost], [Stage], [createdate], [updatedate], [addedby]) VALUES (11, 2, 5, NULL, 40, 6, 9, 50, N'Aug-2019', NULL, 0, 2, CAST(N'2019-09-03 15:01:23.550' AS DateTime), NULL, 5)
INSERT [dbo].[tblApplicants] ([ApplicantID], [PositionID], [CandidateID], [RecruiterComments], [NoticePeriodDays], [CurrentSalary], [ExpectedSalary], [RaisePercentage], [Last_Appraised_On], [IsBuyout], [BuyoutCost], [Stage], [createdate], [updatedate], [addedby]) VALUES (13, 4, 5, NULL, 40, 6, 9, 50, N'Aug-2019', NULL, 0, 2, CAST(N'2019-09-04 14:49:06.863' AS DateTime), NULL, 5)
SET IDENTITY_INSERT [dbo].[tblApplicants] OFF
SET IDENTITY_INSERT [dbo].[tblInterviewRounds] ON 

INSERT [dbo].[tblInterviewRounds] ([RoundID], [ApplicantID], [CandidateID], [RoundType], [Interviewer], [SheduledOn], [InterviewStatus], [InterviewResult], [Rating], [createdate], [updatedate], [addedby], [updatedby]) VALUES (1, 1, 2, N'Telephonic', 5, CAST(N'2019-08-24 05:42:00.000' AS DateTime), 6, 4, 2.6, CAST(N'2019-08-22 17:44:24.387' AS DateTime), CAST(N'2019-08-22 17:51:33.730' AS DateTime), 4, 5)
INSERT [dbo].[tblInterviewRounds] ([RoundID], [ApplicantID], [CandidateID], [RoundType], [Interviewer], [SheduledOn], [InterviewStatus], [InterviewResult], [Rating], [createdate], [updatedate], [addedby], [updatedby]) VALUES (2, 2, 3, N'Telephonic', 5, CAST(N'2019-09-07 05:46:00.000' AS DateTime), 4, NULL, NULL, CAST(N'2019-08-22 17:46:35.053' AS DateTime), NULL, 4, NULL)
INSERT [dbo].[tblInterviewRounds] ([RoundID], [ApplicantID], [CandidateID], [RoundType], [Interviewer], [SheduledOn], [InterviewStatus], [InterviewResult], [Rating], [createdate], [updatedate], [addedby], [updatedby]) VALUES (3, 1, 2, N'F2F', 3, CAST(N'2019-08-24 16:26:00.000' AS DateTime), 4, NULL, NULL, CAST(N'2019-08-23 10:27:02.877' AS DateTime), CAST(N'2019-08-23 11:41:54.640' AS DateTime), 5, 5)
INSERT [dbo].[tblInterviewRounds] ([RoundID], [ApplicantID], [CandidateID], [RoundType], [Interviewer], [SheduledOn], [InterviewStatus], [InterviewResult], [Rating], [createdate], [updatedate], [addedby], [updatedby]) VALUES (6, 3, 2, N'Telephonic', 5, CAST(N'2019-08-24 16:22:00.000' AS DateTime), 2, NULL, NULL, CAST(N'2019-08-23 16:24:21.010' AS DateTime), CAST(N'2019-08-23 16:30:37.117' AS DateTime), 5, 5)
INSERT [dbo].[tblInterviewRounds] ([RoundID], [ApplicantID], [CandidateID], [RoundType], [Interviewer], [SheduledOn], [InterviewStatus], [InterviewResult], [Rating], [createdate], [updatedate], [addedby], [updatedby]) VALUES (7, 3, 2, N'F2F', 5, CAST(N'2019-08-24 16:57:00.000' AS DateTime), 6, 4, 3.8, CAST(N'2019-08-23 16:57:59.917' AS DateTime), CAST(N'2019-08-23 17:43:47.227' AS DateTime), 5, 5)
INSERT [dbo].[tblInterviewRounds] ([RoundID], [ApplicantID], [CandidateID], [RoundType], [Interviewer], [SheduledOn], [InterviewStatus], [InterviewResult], [Rating], [createdate], [updatedate], [addedby], [updatedby]) VALUES (1008, 4, 1, N'Telephonic', 5, CAST(N'2019-08-30 04:44:00.000' AS DateTime), 4, 4, 3.8, CAST(N'2019-08-30 16:48:18.480' AS DateTime), CAST(N'2019-08-30 16:50:15.210' AS DateTime), 5, 5)
INSERT [dbo].[tblInterviewRounds] ([RoundID], [ApplicantID], [CandidateID], [RoundType], [Interviewer], [SheduledOn], [InterviewStatus], [InterviewResult], [Rating], [createdate], [updatedate], [addedby], [updatedby]) VALUES (1018, 9, 6, N'F2F', 5, CAST(N'2019-09-03 12:32:00.000' AS DateTime), 6, 4, 4, CAST(N'2019-09-03 11:32:30.713' AS DateTime), CAST(N'2019-09-03 11:33:05.120' AS DateTime), 5, 5)
INSERT [dbo].[tblInterviewRounds] ([RoundID], [ApplicantID], [CandidateID], [RoundType], [Interviewer], [SheduledOn], [InterviewStatus], [InterviewResult], [Rating], [createdate], [updatedate], [addedby], [updatedby]) VALUES (1010, 6, 5, N'Telephonic', 5, CAST(N'2019-08-30 04:48:00.000' AS DateTime), 5, NULL, NULL, CAST(N'2019-08-30 16:49:11.957' AS DateTime), NULL, 5, NULL)
INSERT [dbo].[tblInterviewRounds] ([RoundID], [ApplicantID], [CandidateID], [RoundType], [Interviewer], [SheduledOn], [InterviewStatus], [InterviewResult], [Rating], [createdate], [updatedate], [addedby], [updatedby]) VALUES (1011, 4, 1, N'Telephonic', 5, CAST(N'2019-09-02 10:10:00.000' AS DateTime), 5, NULL, NULL, CAST(N'2019-09-02 09:52:40.927' AS DateTime), NULL, 5, NULL)
INSERT [dbo].[tblInterviewRounds] ([RoundID], [ApplicantID], [CandidateID], [RoundType], [Interviewer], [SheduledOn], [InterviewStatus], [InterviewResult], [Rating], [createdate], [updatedate], [addedby], [updatedby]) VALUES (1012, 2, 3, N'Telephonic', 5, CAST(N'2019-09-02 11:29:00.000' AS DateTime), 6, 4, 3.6, CAST(N'2019-09-02 11:27:31.840' AS DateTime), CAST(N'2019-09-02 11:28:09.230' AS DateTime), 5, 5)
INSERT [dbo].[tblInterviewRounds] ([RoundID], [ApplicantID], [CandidateID], [RoundType], [Interviewer], [SheduledOn], [InterviewStatus], [InterviewResult], [Rating], [createdate], [updatedate], [addedby], [updatedby]) VALUES (1013, 7, 4, N'Telephonic', 3, CAST(N'2019-09-02 13:37:00.000' AS DateTime), 2, NULL, NULL, CAST(N'2019-09-02 11:37:46.820' AS DateTime), NULL, 5, NULL)
INSERT [dbo].[tblInterviewRounds] ([RoundID], [ApplicantID], [CandidateID], [RoundType], [Interviewer], [SheduledOn], [InterviewStatus], [InterviewResult], [Rating], [createdate], [updatedate], [addedby], [updatedby]) VALUES (1014, 3, 2, N'Telephonic', 5, CAST(N'2019-09-02 17:15:00.000' AS DateTime), 2, NULL, NULL, CAST(N'2019-09-02 15:15:18.877' AS DateTime), NULL, 5, NULL)
INSERT [dbo].[tblInterviewRounds] ([RoundID], [ApplicantID], [CandidateID], [RoundType], [Interviewer], [SheduledOn], [InterviewStatus], [InterviewResult], [Rating], [createdate], [updatedate], [addedby], [updatedby]) VALUES (1019, 9, 6, N'F2F', 5, CAST(N'2019-09-03 12:33:00.000' AS DateTime), 5, 5, 4.8, CAST(N'2019-09-03 11:33:38.167' AS DateTime), CAST(N'2019-09-03 11:34:06.890' AS DateTime), 5, 5)
INSERT [dbo].[tblInterviewRounds] ([RoundID], [ApplicantID], [CandidateID], [RoundType], [Interviewer], [SheduledOn], [InterviewStatus], [InterviewResult], [Rating], [createdate], [updatedate], [addedby], [updatedby]) VALUES (1016, 7, 4, N'Telephonic', 5, CAST(N'2019-09-03 12:58:00.000' AS DateTime), 6, 5, 4.6, CAST(N'2019-09-03 10:59:03.210' AS DateTime), CAST(N'2019-09-03 15:41:12.390' AS DateTime), 5, 5)
INSERT [dbo].[tblInterviewRounds] ([RoundID], [ApplicantID], [CandidateID], [RoundType], [Interviewer], [SheduledOn], [InterviewStatus], [InterviewResult], [Rating], [createdate], [updatedate], [addedby], [updatedby]) VALUES (1017, 9, 6, N'Telephonic', 5, CAST(N'2019-09-03 11:26:00.000' AS DateTime), 4, NULL, NULL, CAST(N'2019-09-03 11:27:20.320' AS DateTime), NULL, 5, NULL)
INSERT [dbo].[tblInterviewRounds] ([RoundID], [ApplicantID], [CandidateID], [RoundType], [Interviewer], [SheduledOn], [InterviewStatus], [InterviewResult], [Rating], [createdate], [updatedate], [addedby], [updatedby]) VALUES (1020, 10, 1, NULL, NULL, CAST(N'2019-09-03 12:49:00.000' AS DateTime), 5, NULL, NULL, CAST(N'2019-09-03 12:49:00.037' AS DateTime), NULL, 5, NULL)
INSERT [dbo].[tblInterviewRounds] ([RoundID], [ApplicantID], [CandidateID], [RoundType], [Interviewer], [SheduledOn], [InterviewStatus], [InterviewResult], [Rating], [createdate], [updatedate], [addedby], [updatedby]) VALUES (1027, 12, 8, N'Telephonic', 5, CAST(N'2019-09-04 14:27:00.000' AS DateTime), 4, NULL, NULL, CAST(N'2019-09-04 14:27:48.753' AS DateTime), NULL, 5, NULL)
INSERT [dbo].[tblInterviewRounds] ([RoundID], [ApplicantID], [CandidateID], [RoundType], [Interviewer], [SheduledOn], [InterviewStatus], [InterviewResult], [Rating], [createdate], [updatedate], [addedby], [updatedby]) VALUES (1029, 14, 7, N'Telephonic', 5, CAST(N'2019-09-04 15:50:00.000' AS DateTime), 6, 4, 4.2, CAST(N'2019-09-04 15:50:39.200' AS DateTime), CAST(N'2019-09-04 15:52:09.313' AS DateTime), 5, 5)
INSERT [dbo].[tblInterviewRounds] ([RoundID], [ApplicantID], [CandidateID], [RoundType], [Interviewer], [SheduledOn], [InterviewStatus], [InterviewResult], [Rating], [createdate], [updatedate], [addedby], [updatedby]) VALUES (1030, 15, 4, N'Telephonic', 5, CAST(N'2019-09-04 15:51:00.000' AS DateTime), 6, 4, 4.8, CAST(N'2019-09-04 15:51:37.233' AS DateTime), CAST(N'2019-09-04 15:52:28.933' AS DateTime), 5, 5)
INSERT [dbo].[tblInterviewRounds] ([RoundID], [ApplicantID], [CandidateID], [RoundType], [Interviewer], [SheduledOn], [InterviewStatus], [InterviewResult], [Rating], [createdate], [updatedate], [addedby], [updatedby]) VALUES (1031, 15, 4, N'Telephonic', 5, CAST(N'2019-09-04 15:52:00.000' AS DateTime), 6, 4, 4.2, CAST(N'2019-09-04 15:52:55.913' AS DateTime), CAST(N'2019-09-04 15:54:59.843' AS DateTime), 5, 5)
INSERT [dbo].[tblInterviewRounds] ([RoundID], [ApplicantID], [CandidateID], [RoundType], [Interviewer], [SheduledOn], [InterviewStatus], [InterviewResult], [Rating], [createdate], [updatedate], [addedby], [updatedby]) VALUES (1032, 16, 9, N'Telephonic', 5, CAST(N'2019-09-04 15:55:00.000' AS DateTime), 6, 4, 4.6, CAST(N'2019-09-04 15:55:48.373' AS DateTime), CAST(N'2019-09-04 15:56:17.297' AS DateTime), 5, 5)
INSERT [dbo].[tblInterviewRounds] ([RoundID], [ApplicantID], [CandidateID], [RoundType], [Interviewer], [SheduledOn], [InterviewStatus], [InterviewResult], [Rating], [createdate], [updatedate], [addedby], [updatedby]) VALUES (8, 2, 3, N'Telephonic', 5, CAST(N'2019-08-27 17:37:00.000' AS DateTime), 2, NULL, NULL, CAST(N'2019-08-26 17:37:11.700' AS DateTime), NULL, 5, NULL)
INSERT [dbo].[tblInterviewRounds] ([RoundID], [ApplicantID], [CandidateID], [RoundType], [Interviewer], [SheduledOn], [InterviewStatus], [InterviewResult], [Rating], [createdate], [updatedate], [addedby], [updatedby]) VALUES (1028, 13, 5, N'Telephonic', 5, CAST(N'2019-09-04 14:49:00.000' AS DateTime), 4, 4, 4.2, CAST(N'2019-09-04 14:49:06.863' AS DateTime), CAST(N'2019-09-04 15:03:03.013' AS DateTime), 5, 5)
INSERT [dbo].[tblInterviewRounds] ([RoundID], [ApplicantID], [CandidateID], [RoundType], [Interviewer], [SheduledOn], [InterviewStatus], [InterviewResult], [Rating], [createdate], [updatedate], [addedby], [updatedby]) VALUES (1021, 11, 5, N'Telephonic', 5, CAST(N'2019-09-03 16:01:00.000' AS DateTime), 6, 4, 4.2, CAST(N'2019-09-03 15:01:23.617' AS DateTime), CAST(N'2019-09-03 15:01:51.813' AS DateTime), 5, 5)
INSERT [dbo].[tblInterviewRounds] ([RoundID], [ApplicantID], [CandidateID], [RoundType], [Interviewer], [SheduledOn], [InterviewStatus], [InterviewResult], [Rating], [createdate], [updatedate], [addedby], [updatedby]) VALUES (1022, 11, 5, N'F2F', 5, CAST(N'2019-09-03 17:02:00.000' AS DateTime), 5, 4, 4, CAST(N'2019-09-03 15:03:07.353' AS DateTime), CAST(N'2019-09-03 15:03:35.817' AS DateTime), 5, 5)
INSERT [dbo].[tblInterviewRounds] ([RoundID], [ApplicantID], [CandidateID], [RoundType], [Interviewer], [SheduledOn], [InterviewStatus], [InterviewResult], [Rating], [createdate], [updatedate], [addedby], [updatedby]) VALUES (1023, 3, 2, N'Telephonic', 5, CAST(N'2019-09-03 16:04:00.000' AS DateTime), 5, 5, 4.4, CAST(N'2019-09-03 15:04:17.000' AS DateTime), CAST(N'2019-09-03 15:04:43.363' AS DateTime), 5, 5)
INSERT [dbo].[tblInterviewRounds] ([RoundID], [ApplicantID], [CandidateID], [RoundType], [Interviewer], [SheduledOn], [InterviewStatus], [InterviewResult], [Rating], [createdate], [updatedate], [addedby], [updatedby]) VALUES (1026, 7, 4, N'F2F', 5, CAST(N'2019-09-03 17:03:00.000' AS DateTime), 1, NULL, NULL, CAST(N'2019-09-03 16:58:14.430' AS DateTime), NULL, 5, NULL)
INSERT [dbo].[tblInterviewRounds] ([RoundID], [ApplicantID], [CandidateID], [RoundType], [Interviewer], [SheduledOn], [InterviewStatus], [InterviewResult], [Rating], [createdate], [updatedate], [addedby], [updatedby]) VALUES (1024, 2, 3, N'Telephonic', 5, CAST(N'2019-09-03 15:52:00.000' AS DateTime), 1, NULL, NULL, CAST(N'2019-09-03 15:48:15.633' AS DateTime), NULL, 5, NULL)
INSERT [dbo].[tblInterviewRounds] ([RoundID], [ApplicantID], [CandidateID], [RoundType], [Interviewer], [SheduledOn], [InterviewStatus], [InterviewResult], [Rating], [createdate], [updatedate], [addedby], [updatedby]) VALUES (1033, 12, 8, N'Telephonic', 5, CAST(N'2019-09-04 17:09:00.000' AS DateTime), 1, NULL, NULL, CAST(N'2019-09-04 17:09:11.303' AS DateTime), NULL, 5, NULL)
INSERT [dbo].[tblInterviewRounds] ([RoundID], [ApplicantID], [CandidateID], [RoundType], [Interviewer], [SheduledOn], [InterviewStatus], [InterviewResult], [Rating], [createdate], [updatedate], [addedby], [updatedby]) VALUES (1034, 13, 5, N'Telephonic', 5, CAST(N'2019-09-04 17:09:00.000' AS DateTime), 1, NULL, NULL, CAST(N'2019-09-04 17:09:39.187' AS DateTime), NULL, 5, NULL)
SET IDENTITY_INSERT [dbo].[tblInterviewRounds] OFF
SET IDENTITY_INSERT [dbo].[tblJobDescription] ON 

INSERT [dbo].[tblJobDescription] ([JobID], [PositionID], [JobDescription], [AddedBy], [CreateDate], [UpdatedBy], [UpdatedDate], [ApproveStatus], [ApprovedBy], [ApprovedDate]) VALUES (1, 1, N'&lt;p&gt;&amp;nbsp;df dafdasf asd f&lt;/p&gt;', 4, CAST(N'2019-08-22 17:25:52.400' AS DateTime), 5, CAST(N'2019-08-22 17:29:04.997' AS DateTime), 2, 5, CAST(N'2019-08-22 17:29:07.600' AS DateTime))
INSERT [dbo].[tblJobDescription] ([JobID], [PositionID], [JobDescription], [AddedBy], [CreateDate], [UpdatedBy], [UpdatedDate], [ApproveStatus], [ApprovedBy], [ApprovedDate]) VALUES (2, 2, N'&lt;p&gt;sd fasdf asdf&lt;/p&gt;', 4, CAST(N'2019-08-22 17:26:03.430' AS DateTime), NULL, NULL, 2, 5, CAST(N'2019-08-22 17:29:12.970' AS DateTime))
INSERT [dbo].[tblJobDescription] ([JobID], [PositionID], [JobDescription], [AddedBy], [CreateDate], [UpdatedBy], [UpdatedDate], [ApproveStatus], [ApprovedBy], [ApprovedDate]) VALUES (3, 3, N'&lt;p&gt;fsdfsdfsdaf&lt;/p&gt;', 5, CAST(N'2019-08-30 16:43:25.897' AS DateTime), NULL, NULL, 2, 5, CAST(N'2019-08-30 16:43:30.007' AS DateTime))
INSERT [dbo].[tblJobDescription] ([JobID], [PositionID], [JobDescription], [AddedBy], [CreateDate], [UpdatedBy], [UpdatedDate], [ApproveStatus], [ApprovedBy], [ApprovedDate]) VALUES (4, 4, N'&lt;p&gt;fghfgdhfgdhfd&lt;/p&gt;', 5, CAST(N'2019-09-04 12:55:47.837' AS DateTime), 5, CAST(N'2019-09-04 12:55:51.870' AS DateTime), 2, 5, CAST(N'2019-09-04 12:56:01.240' AS DateTime))
INSERT [dbo].[tblJobDescription] ([JobID], [PositionID], [JobDescription], [AddedBy], [CreateDate], [UpdatedBy], [UpdatedDate], [ApproveStatus], [ApprovedBy], [ApprovedDate]) VALUES (5, 5, N'&lt;p&gt;fhgjghghmnhgm&lt;/p&gt;', 5, CAST(N'2019-09-04 12:56:34.680' AS DateTime), NULL, NULL, 2, 5, CAST(N'2019-09-04 12:56:41.613' AS DateTime))
SET IDENTITY_INSERT [dbo].[tblJobDescription] OFF
SET IDENTITY_INSERT [dbo].[tblMasterCandidatePool] ON 

INSERT [dbo].[tblMasterCandidatePool] ([CandidateID], [Name], [Gender], [Experience], [EmailID], [Phone], [Education], [Year_of_Passing], [InterestedDepartmentID], [ProfessionalSummary], [LastCompany], [PrimaryIndustry], [PreviousNotableOrganisations], [CandidateStatus], [Source], [SourcingDate], [LastContactedDate], [ResumeGoogleLink], [ResumeName], [createdate], [updatedate], [addedby], [Iscandidate], [ApplicantDate], [LastApplicantID], [Active]) VALUES (1, N'Rahul Gupta', N'Male', 2, N'rahul@gmal.com', N'9874563210', N'm-tech', N'2018', 1, N'&lt;p&gt;SF CSD FSA&lt;/p&gt;', NULL, NULL, NULL, N'Working', N'2', CAST(N'2019-08-22 00:00:00.000' AS DateTime), CAST(N'2019-02-02 00:00:00.000' AS DateTime), N'http://google.com', N'Vivek Gupta637020911082707028.pdf', CAST(N'2019-08-22 17:18:28.330' AS DateTime), NULL, 4, 1, CAST(N'2019-09-03 12:49:00.037' AS DateTime), 10, 1)
INSERT [dbo].[tblMasterCandidatePool] ([CandidateID], [Name], [Gender], [Experience], [EmailID], [Phone], [Education], [Year_of_Passing], [InterestedDepartmentID], [ProfessionalSummary], [LastCompany], [PrimaryIndustry], [PreviousNotableOrganisations], [CandidateStatus], [Source], [SourcingDate], [LastContactedDate], [ResumeGoogleLink], [ResumeName], [createdate], [updatedate], [addedby], [Iscandidate], [ApplicantDate], [LastApplicantID], [Active]) VALUES (2, N'Dinesh Singh', N'Male', 2, N'Dinesh@gmal.com', N'9874563210', N'm-tech', N'2018', 1, N'&lt;p&gt;SF CSD FSA&lt;/p&gt;', NULL, NULL, NULL, N'Working', N'1', CAST(N'2019-08-22 00:00:00.000' AS DateTime), CAST(N'2019-02-02 00:00:00.000' AS DateTime), N'http://google.com', N'Vivek Gupta637020911082707028.pdf', CAST(N'2019-08-22 17:18:28.330' AS DateTime), NULL, 4, 1, CAST(N'2019-09-03 15:31:38.483' AS DateTime), 11, 1)
INSERT [dbo].[tblMasterCandidatePool] ([CandidateID], [Name], [Gender], [Experience], [EmailID], [Phone], [Education], [Year_of_Passing], [InterestedDepartmentID], [ProfessionalSummary], [LastCompany], [PrimaryIndustry], [PreviousNotableOrganisations], [CandidateStatus], [Source], [SourcingDate], [LastContactedDate], [ResumeGoogleLink], [ResumeName], [createdate], [updatedate], [addedby], [Iscandidate], [ApplicantDate], [LastApplicantID], [Active]) VALUES (3, N'Pushkar', N'Male', 2, N'Pushkar@gmal.com', N'9874563210', N'm-tech', N'2018', 1, N'&lt;p&gt;SF CSD FSA&lt;/p&gt;', NULL, NULL, NULL, N'Working', N'2', CAST(N'2019-08-22 00:00:00.000' AS DateTime), CAST(N'2019-02-02 00:00:00.000' AS DateTime), N'http://google.com', N'Vivek Gupta637020911082707028.pdf', CAST(N'2019-08-22 17:18:28.330' AS DateTime), NULL, 4, 1, CAST(N'2019-08-30 16:48:48.797' AS DateTime), 5, 1)
INSERT [dbo].[tblMasterCandidatePool] ([CandidateID], [Name], [Gender], [Experience], [EmailID], [Phone], [Education], [Year_of_Passing], [InterestedDepartmentID], [ProfessionalSummary], [LastCompany], [PrimaryIndustry], [PreviousNotableOrganisations], [CandidateStatus], [Source], [SourcingDate], [LastContactedDate], [ResumeGoogleLink], [ResumeName], [createdate], [updatedate], [addedby], [Iscandidate], [ApplicantDate], [LastApplicantID], [Active]) VALUES (4, N'Vikas', N'Male', 2, N'vikas@gmal.com', N'9874563210', N'm-tech', N'2018', 1, N'<p>SF CSD FSA</p>', N'', N'', N'', N'Working', N'2', CAST(N'2019-08-22 00:00:00.000' AS DateTime), CAST(N'2019-02-02 00:00:00.000' AS DateTime), N'', N'Vivek Gupta637020911082707028.pdf', CAST(N'2019-08-22 17:18:28.000' AS DateTime), CAST(N'2019-11-08 12:18:18.000' AS DateTime), 4, 1, CAST(N'2019-09-04 15:51:37.000' AS DateTime), 15, 1)
INSERT [dbo].[tblMasterCandidatePool] ([CandidateID], [Name], [Gender], [Experience], [EmailID], [Phone], [Education], [Year_of_Passing], [InterestedDepartmentID], [ProfessionalSummary], [LastCompany], [PrimaryIndustry], [PreviousNotableOrganisations], [CandidateStatus], [Source], [SourcingDate], [LastContactedDate], [ResumeGoogleLink], [ResumeName], [createdate], [updatedate], [addedby], [Iscandidate], [ApplicantDate], [LastApplicantID], [Active]) VALUES (5, N'Rakesh', N'Male', 2, N'Rakesh@gmal.com', N'9874563210', N'm-tech', N'2018', 1, N'&lt;p&gt;SF CSD FSA&lt;/p&gt;', NULL, NULL, NULL, N'Working', N'2', CAST(N'2019-08-22 00:00:00.000' AS DateTime), NULL, N'http://google.com', N'Vivek Gupta637020911082707028.pdf', CAST(N'2019-08-22 17:18:28.330' AS DateTime), NULL, 4, 1, CAST(N'2019-09-04 14:49:06.863' AS DateTime), 13, 1)
INSERT [dbo].[tblMasterCandidatePool] ([CandidateID], [Name], [Gender], [Experience], [EmailID], [Phone], [Education], [Year_of_Passing], [InterestedDepartmentID], [ProfessionalSummary], [LastCompany], [PrimaryIndustry], [PreviousNotableOrganisations], [CandidateStatus], [Source], [SourcingDate], [LastContactedDate], [ResumeGoogleLink], [ResumeName], [createdate], [updatedate], [addedby], [Iscandidate], [ApplicantDate], [LastApplicantID], [Active]) VALUES (6, N'Nicky', N'Male', 2, N'Nicky@gmal.com', N'9874563210', N'm-tech', N'2018', 1, N'&lt;p&gt;SF CSD FSA&lt;/p&gt;', NULL, NULL, NULL, N'Working', N'2', CAST(N'2019-08-22 00:00:00.000' AS DateTime), CAST(N'2019-02-02 00:00:00.000' AS DateTime), N'http://google.com', N'Vivek Gupta637020911082707028.pdf', CAST(N'2019-08-22 17:18:28.330' AS DateTime), NULL, 4, 1, CAST(N'2019-09-03 11:35:34.593' AS DateTime), 9, 1)
INSERT [dbo].[tblMasterCandidatePool] ([CandidateID], [Name], [Gender], [Experience], [EmailID], [Phone], [Education], [Year_of_Passing], [InterestedDepartmentID], [ProfessionalSummary], [LastCompany], [PrimaryIndustry], [PreviousNotableOrganisations], [CandidateStatus], [Source], [SourcingDate], [LastContactedDate], [ResumeGoogleLink], [ResumeName], [createdate], [updatedate], [addedby], [Iscandidate], [ApplicantDate], [LastApplicantID], [Active]) VALUES (7, N'Ashish', N'Male', 2, N'ashish@gmal.com', N'9874563210', N'm-tech', N'2018', 1, N'&lt;p&gt;SF CSD FSA&lt;/p&gt;', NULL, NULL, NULL, N'Working', N'1', CAST(N'2019-08-22 00:00:00.000' AS DateTime), CAST(N'2019-02-02 00:00:00.000' AS DateTime), N'http://google.com', N'Vivek Gupta637020911082707028.pdf', CAST(N'2019-08-22 17:18:28.330' AS DateTime), CAST(N'2019-08-22 18:23:40.700' AS DateTime), 5, 1, CAST(N'2019-09-04 15:50:39.200' AS DateTime), 14, 1)
INSERT [dbo].[tblMasterCandidatePool] ([CandidateID], [Name], [Gender], [Experience], [EmailID], [Phone], [Education], [Year_of_Passing], [InterestedDepartmentID], [ProfessionalSummary], [LastCompany], [PrimaryIndustry], [PreviousNotableOrganisations], [CandidateStatus], [Source], [SourcingDate], [LastContactedDate], [ResumeGoogleLink], [ResumeName], [createdate], [updatedate], [addedby], [Iscandidate], [ApplicantDate], [LastApplicantID], [Active]) VALUES (8, N'Rayesh', N'Male', 2, N'rayesh@gmail.com', N'8545632589', N'B-Tech', N'2016', 1, N'&lt;p&gt;dgfdgfdgfdgfdg&lt;/p&gt;', N'gfdsg', N'dfgfdsg', N'fdgsfdg', N'Working', N'1', CAST(N'2019-08-29 00:00:00.000' AS DateTime), CAST(N'2019-08-29 00:00:00.000' AS DateTime), N'https://api.jquery.com/empty/', NULL, CAST(N'2019-08-30 16:33:28.853' AS DateTime), NULL, 5, 1, CAST(N'2019-09-04 15:00:33.043' AS DateTime), 13, 1)
INSERT [dbo].[tblMasterCandidatePool] ([CandidateID], [Name], [Gender], [Experience], [EmailID], [Phone], [Education], [Year_of_Passing], [InterestedDepartmentID], [ProfessionalSummary], [LastCompany], [PrimaryIndustry], [PreviousNotableOrganisations], [CandidateStatus], [Source], [SourcingDate], [LastContactedDate], [ResumeGoogleLink], [ResumeName], [createdate], [updatedate], [addedby], [Iscandidate], [ApplicantDate], [LastApplicantID], [Active]) VALUES (9, N'Ramesh', N'Male', 3, N'ramesh@gmail.com', N'8452456985', N'MCA', N'2015', 1, N'&lt;p&gt;fgfdf bvnfgg&lt;/p&gt;', N'fghfghfgh', N'fhfghfgh', N'fghfgdhfgdh', N'Working', N'1', CAST(N'2019-09-04 00:00:00.000' AS DateTime), CAST(N'2019-09-04 00:00:00.000' AS DateTime), N'https://api.jquery.com/empty/', NULL, CAST(N'2019-09-04 15:46:51.763' AS DateTime), NULL, 5, 1, CAST(N'2019-09-04 15:55:48.373' AS DateTime), 16, 1)
INSERT [dbo].[tblMasterCandidatePool] ([CandidateID], [Name], [Gender], [Experience], [EmailID], [Phone], [Education], [Year_of_Passing], [InterestedDepartmentID], [ProfessionalSummary], [LastCompany], [PrimaryIndustry], [PreviousNotableOrganisations], [CandidateStatus], [Source], [SourcingDate], [LastContactedDate], [ResumeGoogleLink], [ResumeName], [createdate], [updatedate], [addedby], [Iscandidate], [ApplicantDate], [LastApplicantID], [Active]) VALUES (10, N'Pankaj', N'Male', 2, N'pankaj@gmail.com', N'5425689545', N'MCA', N'2012', 1, N'&lt;p&gt;dfgfdgfdgfd&lt;/p&gt;', N'dfgfdg', N'fdgfdsg', N'fdgfdg', N'Working', N'1', CAST(N'2019-09-04 00:00:00.000' AS DateTime), CAST(N'2019-09-04 00:00:00.000' AS DateTime), N'https://api.jquery.com/empty/', NULL, CAST(N'2019-09-04 17:03:19.577' AS DateTime), NULL, 5, 1, NULL, NULL, 0)
SET IDENTITY_INSERT [dbo].[tblMasterCandidatePool] OFF
SET IDENTITY_INSERT [dbo].[tblMasterDepartment] ON 

INSERT [dbo].[tblMasterDepartment] ([DepartmentID], [DepartmentName]) VALUES (1, N'Business Development')
INSERT [dbo].[tblMasterDepartment] ([DepartmentID], [DepartmentName]) VALUES (2, N'Content')
INSERT [dbo].[tblMasterDepartment] ([DepartmentID], [DepartmentName]) VALUES (3, N'Client Service')
INSERT [dbo].[tblMasterDepartment] ([DepartmentID], [DepartmentName]) VALUES (4, N'Pay Per Click Marketing')
INSERT [dbo].[tblMasterDepartment] ([DepartmentID], [DepartmentName]) VALUES (5, N'Design')
INSERT [dbo].[tblMasterDepartment] ([DepartmentID], [DepartmentName]) VALUES (6, N'Development')
INSERT [dbo].[tblMasterDepartment] ([DepartmentID], [DepartmentName]) VALUES (7, N'SEO')
INSERT [dbo].[tblMasterDepartment] ([DepartmentID], [DepartmentName]) VALUES (8, N'BD')
SET IDENTITY_INSERT [dbo].[tblMasterDepartment] OFF
SET IDENTITY_INSERT [dbo].[tblMasterDesignation] ON 

INSERT [dbo].[tblMasterDesignation] ([DesignationID], [DesignationName], [DepartmentID]) VALUES (1, N'BD Head', 1)
INSERT [dbo].[tblMasterDesignation] ([DesignationID], [DesignationName], [DepartmentID]) VALUES (2, N'BD Manager', 1)
INSERT [dbo].[tblMasterDesignation] ([DesignationID], [DesignationName], [DepartmentID]) VALUES (3, N'PPC Head', 4)
INSERT [dbo].[tblMasterDesignation] ([DesignationID], [DesignationName], [DepartmentID]) VALUES (4, N'Content Writer', 2)
SET IDENTITY_INSERT [dbo].[tblMasterDesignation] OFF
SET IDENTITY_INSERT [dbo].[tblMasterHiringStatus] ON 

INSERT [dbo].[tblMasterHiringStatus] ([HiringID], [StatusName]) VALUES (5, N'No hire')
INSERT [dbo].[tblMasterHiringStatus] ([HiringID], [StatusName]) VALUES (2, N'Interviewing')
INSERT [dbo].[tblMasterHiringStatus] ([HiringID], [StatusName]) VALUES (3, N'Decision needed')
INSERT [dbo].[tblMasterHiringStatus] ([HiringID], [StatusName]) VALUES (1, N'Not started')
INSERT [dbo].[tblMasterHiringStatus] ([HiringID], [StatusName]) VALUES (4, N'Hire')
SET IDENTITY_INSERT [dbo].[tblMasterHiringStatus] OFF
SET IDENTITY_INSERT [dbo].[tblMasterInterviewResult] ON 

INSERT [dbo].[tblMasterInterviewResult] ([StatusID], [Result]) VALUES (1, N'No Hire')
INSERT [dbo].[tblMasterInterviewResult] ([StatusID], [Result]) VALUES (2, N'Probable')
INSERT [dbo].[tblMasterInterviewResult] ([StatusID], [Result]) VALUES (3, N'Worth Consideration')
INSERT [dbo].[tblMasterInterviewResult] ([StatusID], [Result]) VALUES (4, N'Good Candidate')
INSERT [dbo].[tblMasterInterviewResult] ([StatusID], [Result]) VALUES (5, N'Hire')
SET IDENTITY_INSERT [dbo].[tblMasterInterviewResult] OFF
SET IDENTITY_INSERT [dbo].[tblMasterInterviewStatus] ON 

INSERT [dbo].[tblMasterInterviewStatus] ([InterviewStatusID], [StatusName], [Role]) VALUES (1, N'Pending', 3)
INSERT [dbo].[tblMasterInterviewStatus] ([InterviewStatusID], [StatusName], [Role]) VALUES (2, N'Pending with interviewer', 4)
INSERT [dbo].[tblMasterInterviewStatus] ([InterviewStatusID], [StatusName], [Role]) VALUES (3, N'Pending with interviewee', 4)
INSERT [dbo].[tblMasterInterviewStatus] ([InterviewStatusID], [StatusName], [Role]) VALUES (4, N'Position on Hold', 4)
INSERT [dbo].[tblMasterInterviewStatus] ([InterviewStatusID], [StatusName], [Role]) VALUES (5, N'Position Filled', 4)
INSERT [dbo].[tblMasterInterviewStatus] ([InterviewStatusID], [StatusName], [Role]) VALUES (6, N'Done', 3)
SET IDENTITY_INSERT [dbo].[tblMasterInterviewStatus] OFF
SET IDENTITY_INSERT [dbo].[tblMasterRating] ON 

INSERT [dbo].[tblMasterRating] ([RatingID], [RatingName]) VALUES (1, N'Communication')
INSERT [dbo].[tblMasterRating] ([RatingID], [RatingName]) VALUES (2, N'Job Knowledge')
INSERT [dbo].[tblMasterRating] ([RatingID], [RatingName]) VALUES (3, N'Past Experience')
INSERT [dbo].[tblMasterRating] ([RatingID], [RatingName]) VALUES (4, N'Company Fitness')
INSERT [dbo].[tblMasterRating] ([RatingID], [RatingName]) VALUES (5, N'Attitude')
SET IDENTITY_INSERT [dbo].[tblMasterRating] OFF
SET IDENTITY_INSERT [dbo].[tblMasterRole] ON 

INSERT [dbo].[tblMasterRole] ([RoleID], [RoleName]) VALUES (1, N'Admin')
INSERT [dbo].[tblMasterRole] ([RoleID], [RoleName]) VALUES (2, N'HR')
INSERT [dbo].[tblMasterRole] ([RoleID], [RoleName]) VALUES (3, N'User')
INSERT [dbo].[tblMasterRole] ([RoleID], [RoleName]) VALUES (4, N'Recruiter')
SET IDENTITY_INSERT [dbo].[tblMasterRole] OFF
SET IDENTITY_INSERT [dbo].[tblMasterSource] ON 

INSERT [dbo].[tblMasterSource] ([SourceID], [SourceName]) VALUES (1, N'LinkedIn')
INSERT [dbo].[tblMasterSource] ([SourceID], [SourceName]) VALUES (2, N'Monster')
INSERT [dbo].[tblMasterSource] ([SourceID], [SourceName]) VALUES (3, N'Naukri')
SET IDENTITY_INSERT [dbo].[tblMasterSource] OFF
SET IDENTITY_INSERT [dbo].[tblMasterUnit] ON 

INSERT [dbo].[tblMasterUnit] ([unitID], [UnitName]) VALUES (1, N'Envigo')
INSERT [dbo].[tblMasterUnit] ([unitID], [UnitName]) VALUES (2, N'IBISM')
SET IDENTITY_INSERT [dbo].[tblMasterUnit] OFF
SET IDENTITY_INSERT [dbo].[tblPositions] ON 

INSERT [dbo].[tblPositions] ([PositionID], [DesignationID], [RequesterID], [Department], [Unit], [Priority], [TAT], [RequestDate], [ClosedByDate], [Experience], [YearlySalaryBudget], [Status], [JDStatus], [Closure_Date], [SelectedCandidateID], [Remark], [UpdatedBy], [UpdatedDate]) VALUES (1, 1, 5, 1, 1, N'High', CAST(N'2019-09-02 00:00:00.000' AS DateTime), CAST(N'2019-08-22 17:23:39.580' AS DateTime), CAST(N'2019-08-31 00:00:00.000' AS DateTime), 2, 0, N'ReOpen', 2, NULL, NULL, NULL, NULL, NULL)
INSERT [dbo].[tblPositions] ([PositionID], [DesignationID], [RequesterID], [Department], [Unit], [Priority], [TAT], [RequestDate], [ClosedByDate], [Experience], [YearlySalaryBudget], [Status], [JDStatus], [Closure_Date], [SelectedCandidateID], [Remark], [UpdatedBy], [UpdatedDate]) VALUES (2, 2, 5, 1, 1, N'Medium', CAST(N'2019-09-06 00:00:00.000' AS DateTime), CAST(N'2019-08-22 17:24:36.143' AS DateTime), CAST(N'2019-08-31 00:00:00.000' AS DateTime), 3, 0, N'Closed', 2, CAST(N'2019-09-03 15:31:38.497' AS DateTime), 2, NULL, 5, CAST(N'2019-09-03 15:31:38.497' AS DateTime))
INSERT [dbo].[tblPositions] ([PositionID], [DesignationID], [RequesterID], [Department], [Unit], [Priority], [TAT], [RequestDate], [ClosedByDate], [Experience], [YearlySalaryBudget], [Status], [JDStatus], [Closure_Date], [SelectedCandidateID], [Remark], [UpdatedBy], [UpdatedDate]) VALUES (3, 3, 5, 4, 1, N'High', CAST(N'2019-09-10 00:00:00.000' AS DateTime), CAST(N'2019-08-30 16:43:19.043' AS DateTime), CAST(N'2019-08-31 00:00:00.000' AS DateTime), 2, 600000, N'Closed', 2, CAST(N'2019-09-03 11:35:34.600' AS DateTime), 6, NULL, 5, CAST(N'2019-09-03 11:35:34.600' AS DateTime))
INSERT [dbo].[tblPositions] ([PositionID], [DesignationID], [RequesterID], [Department], [Unit], [Priority], [TAT], [RequestDate], [ClosedByDate], [Experience], [YearlySalaryBudget], [Status], [JDStatus], [Closure_Date], [SelectedCandidateID], [Remark], [UpdatedBy], [UpdatedDate]) VALUES (4, 1, 5, 1, 2, N'High', CAST(N'2019-09-11 00:00:00.000' AS DateTime), CAST(N'2019-09-04 12:55:33.650' AS DateTime), CAST(N'2019-09-27 00:00:00.000' AS DateTime), 2, 0, N'ReOpen', 2, NULL, NULL, NULL, 5, CAST(N'2019-09-04 15:56:52.783' AS DateTime))
INSERT [dbo].[tblPositions] ([PositionID], [DesignationID], [RequesterID], [Department], [Unit], [Priority], [TAT], [RequestDate], [ClosedByDate], [Experience], [YearlySalaryBudget], [Status], [JDStatus], [Closure_Date], [SelectedCandidateID], [Remark], [UpdatedBy], [UpdatedDate]) VALUES (5, 2, 5, 1, 1, N'Medium', CAST(N'2019-09-19 00:00:00.000' AS DateTime), CAST(N'2019-09-04 12:56:24.810' AS DateTime), CAST(N'2019-09-30 00:00:00.000' AS DateTime), 4, 0, N'Open', 2, NULL, NULL, NULL, NULL, NULL)
INSERT [dbo].[tblPositions] ([PositionID], [DesignationID], [RequesterID], [Department], [Unit], [Priority], [TAT], [RequestDate], [ClosedByDate], [Experience], [YearlySalaryBudget], [Status], [JDStatus], [Closure_Date], [SelectedCandidateID], [Remark], [UpdatedBy], [UpdatedDate]) VALUES (6, 1, 5, 1, 1, N'High', CAST(N'2019-09-12 00:00:00.000' AS DateTime), CAST(N'2019-09-04 17:41:39.353' AS DateTime), CAST(N'2019-09-04 00:00:00.000' AS DateTime), 1, 0, N'Open', 0, NULL, NULL, NULL, NULL, NULL)
SET IDENTITY_INSERT [dbo].[tblPositions] OFF
SET IDENTITY_INSERT [dbo].[tblSuggestedApplicants] ON 

INSERT [dbo].[tblSuggestedApplicants] ([SelectionID], [PositionID], [Candidate], [CurrentStatus], [ShareDate], [ApproveDate], [RejectDate]) VALUES (10, 2, N'2', N'Approve', CAST(N'2019-08-23 15:18:54.740' AS DateTime), CAST(N'2019-08-23 15:19:17.017' AS DateTime), NULL)
INSERT [dbo].[tblSuggestedApplicants] ([SelectionID], [PositionID], [Candidate], [CurrentStatus], [ShareDate], [ApproveDate], [RejectDate]) VALUES (11, 2, N'3', N'Reject', CAST(N'2019-08-23 15:18:54.750' AS DateTime), NULL, CAST(N'2019-08-23 15:19:19.130' AS DateTime))
INSERT [dbo].[tblSuggestedApplicants] ([SelectionID], [PositionID], [Candidate], [CurrentStatus], [ShareDate], [ApproveDate], [RejectDate]) VALUES (12, 2, N'4', N'Selected', CAST(N'2019-09-03 13:03:06.143' AS DateTime), NULL, NULL)
INSERT [dbo].[tblSuggestedApplicants] ([SelectionID], [PositionID], [Candidate], [CurrentStatus], [ShareDate], [ApproveDate], [RejectDate]) VALUES (14, 1, N'3', N'Approve', CAST(N'2019-08-26 17:34:17.717' AS DateTime), NULL, NULL)
INSERT [dbo].[tblSuggestedApplicants] ([SelectionID], [PositionID], [Candidate], [CurrentStatus], [ShareDate], [ApproveDate], [RejectDate]) VALUES (1014, 1, N'4', N'Approve', CAST(N'2019-08-30 11:33:52.150' AS DateTime), CAST(N'2019-09-02 11:34:08.843' AS DateTime), NULL)
INSERT [dbo].[tblSuggestedApplicants] ([SelectionID], [PositionID], [Candidate], [CurrentStatus], [ShareDate], [ApproveDate], [RejectDate]) VALUES (1026, 3, N'6', N'Approve', CAST(N'2019-09-03 11:27:56.723' AS DateTime), NULL, NULL)
INSERT [dbo].[tblSuggestedApplicants] ([SelectionID], [PositionID], [Candidate], [CurrentStatus], [ShareDate], [ApproveDate], [RejectDate]) VALUES (1017, 3, N'4', N'Selected', CAST(N'2019-08-30 16:43:48.197' AS DateTime), NULL, NULL)
INSERT [dbo].[tblSuggestedApplicants] ([SelectionID], [PositionID], [Candidate], [CurrentStatus], [ShareDate], [ApproveDate], [RejectDate]) VALUES (1042, 4, N'10', N'Approve', CAST(N'2019-09-04 17:03:30.317' AS DateTime), CAST(N'2019-09-04 17:03:40.377' AS DateTime), NULL)
INSERT [dbo].[tblSuggestedApplicants] ([SelectionID], [PositionID], [Candidate], [CurrentStatus], [ShareDate], [ApproveDate], [RejectDate]) VALUES (1036, 4, N'1', N'Approve', CAST(N'2019-09-04 15:20:45.457' AS DateTime), CAST(N'2019-09-04 15:20:54.110' AS DateTime), NULL)
INSERT [dbo].[tblSuggestedApplicants] ([SelectionID], [PositionID], [Candidate], [CurrentStatus], [ShareDate], [ApproveDate], [RejectDate]) VALUES (1037, 5, N'4', N'Approve', CAST(N'2019-09-04 15:48:57.157' AS DateTime), CAST(N'2019-09-04 15:49:06.440' AS DateTime), NULL)
INSERT [dbo].[tblSuggestedApplicants] ([SelectionID], [PositionID], [Candidate], [CurrentStatus], [ShareDate], [ApproveDate], [RejectDate]) VALUES (1038, 5, N'7', N'Approve', CAST(N'2019-09-04 15:48:57.157' AS DateTime), CAST(N'2019-09-04 15:49:04.060' AS DateTime), NULL)
INSERT [dbo].[tblSuggestedApplicants] ([SelectionID], [PositionID], [Candidate], [CurrentStatus], [ShareDate], [ApproveDate], [RejectDate]) VALUES (1039, 5, N'9', N'Approve', CAST(N'2019-09-04 15:48:57.157' AS DateTime), CAST(N'2019-09-04 15:49:05.310' AS DateTime), NULL)
INSERT [dbo].[tblSuggestedApplicants] ([SelectionID], [PositionID], [Candidate], [CurrentStatus], [ShareDate], [ApproveDate], [RejectDate]) VALUES (1040, 4, N'8', N'Approve', CAST(N'2019-09-04 15:59:56.413' AS DateTime), NULL, NULL)
INSERT [dbo].[tblSuggestedApplicants] ([SelectionID], [PositionID], [Candidate], [CurrentStatus], [ShareDate], [ApproveDate], [RejectDate]) VALUES (1041, 4, N'5', N'Approve', CAST(N'2019-09-04 16:00:06.900' AS DateTime), NULL, NULL)
SET IDENTITY_INSERT [dbo].[tblSuggestedApplicants] OFF
SET IDENTITY_INSERT [dbo].[tblUserLogin] ON 

INSERT [dbo].[tblUserLogin] ([UserID], [UserEmail], [UserName], [LastLoginDate], [Createdate], [Status], [Role], [ActivatedDate]) VALUES (4, N'vivekgupta0505@gmail.com', N'Vivek Gupta', NULL, CAST(N'2019-08-22 16:47:03.023' AS DateTime), 1, 4, CAST(N'2019-08-22 16:49:24.367' AS DateTime))
INSERT [dbo].[tblUserLogin] ([UserID], [UserEmail], [UserName], [LastLoginDate], [Createdate], [Status], [Role], [ActivatedDate]) VALUES (5, N'ajeet.kumar@envigo.co.uk', N'Ajeet Kumar', NULL, CAST(N'2019-08-22 16:48:23.100' AS DateTime), 1, 1, CAST(N'2019-08-22 16:48:55.803' AS DateTime))
INSERT [dbo].[tblUserLogin] ([UserID], [UserEmail], [UserName], [LastLoginDate], [Createdate], [Status], [Role], [ActivatedDate]) VALUES (3, N'vivek@envigo.co.uk', N'Vivek Gupta', NULL, CAST(N'2019-08-22 16:14:12.570' AS DateTime), 1, 3, CAST(N'2019-02-02 00:00:00.000' AS DateTime))
SET IDENTITY_INSERT [dbo].[tblUserLogin] OFF
EXEC sys.sp_addextendedproperty @name=N'MS_DiagramPane1', @value=N'[0E232FF0-B466-11cf-A24F-00AA00A3EFFF, 1.00]
Begin DesignProperties = 
   Begin PaneConfigurations = 
      Begin PaneConfiguration = 0
         NumPanes = 4
         Configuration = "(H (1[40] 4[20] 2[20] 3) )"
      End
      Begin PaneConfiguration = 1
         NumPanes = 3
         Configuration = "(H (1 [50] 4 [25] 3))"
      End
      Begin PaneConfiguration = 2
         NumPanes = 3
         Configuration = "(H (1 [50] 2 [25] 3))"
      End
      Begin PaneConfiguration = 3
         NumPanes = 3
         Configuration = "(H (4 [30] 2 [40] 3))"
      End
      Begin PaneConfiguration = 4
         NumPanes = 2
         Configuration = "(H (1 [56] 3))"
      End
      Begin PaneConfiguration = 5
         NumPanes = 2
         Configuration = "(H (2 [66] 3))"
      End
      Begin PaneConfiguration = 6
         NumPanes = 2
         Configuration = "(H (4 [50] 3))"
      End
      Begin PaneConfiguration = 7
         NumPanes = 1
         Configuration = "(V (3))"
      End
      Begin PaneConfiguration = 8
         NumPanes = 3
         Configuration = "(H (1[56] 4[18] 2) )"
      End
      Begin PaneConfiguration = 9
         NumPanes = 2
         Configuration = "(H (1 [75] 4))"
      End
      Begin PaneConfiguration = 10
         NumPanes = 2
         Configuration = "(H (1[66] 2) )"
      End
      Begin PaneConfiguration = 11
         NumPanes = 2
         Configuration = "(H (4 [60] 2))"
      End
      Begin PaneConfiguration = 12
         NumPanes = 1
         Configuration = "(H (1) )"
      End
      Begin PaneConfiguration = 13
         NumPanes = 1
         Configuration = "(V (4))"
      End
      Begin PaneConfiguration = 14
         NumPanes = 1
         Configuration = "(V (2))"
      End
      ActivePaneConfig = 0
   End
   Begin DiagramPane = 
      Begin Origin = 
         Top = 0
         Left = 0
      End
      Begin Tables = 
         Begin Table = "t"
            Begin Extent = 
               Top = 6
               Left = 38
               Bottom = 203
               Right = 287
            End
            DisplayFlags = 280
            TopColumn = 18
         End
         Begin Table = "t1"
            Begin Extent = 
               Top = 6
               Left = 325
               Bottom = 211
               Right = 509
            End
            DisplayFlags = 280
            TopColumn = 0
         End
      End
   End
   Begin SQLPane = 
   End
   Begin DataPane = 
      Begin ParameterDefaults = ""
      End
   End
   Begin CriteriaPane = 
      Begin ColumnWidths = 11
         Column = 1440
         Alias = 900
         Table = 1170
         Output = 720
         Append = 1400
         NewValue = 1170
         SortType = 1350
         SortOrder = 1410
         GroupBy = 1350
         Filter = 1350
         Or = 1350
         Or = 1350
         Or = 1350
      End
   End
End
' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'VIEW',@level1name=N'vwCandidatepool'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_DiagramPaneCount', @value=1 , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'VIEW',@level1name=N'vwCandidatepool'
GO
