CREATE PROCEDURE [dbo].[getDueList]
(
@unit VARCHAR(5 ),
@cc varchar(11),
@quizname VARCHAR( 25 )
)
AS
select unit, JobCCNO, [FULL NAME], SSN, EMPLNO ,[Unit Desc], Department, Manager from dbo.WinEmp
select * from dbo.WinEmp E
where ( (E.Unit like '%'+@unit + '%' or @unit is null )
and ( E.JobCCNo like '%'+ @cc +'%' or @cc is Null ) and (
not exists (
select *
from dbo.[WinQuizLog] L
where (L.[Employee Name]= E.[Full Name] and L.DOB = E.DOB and L.[Quiz Name] like '%' +@quizname +'%' or @quizname is null ) )
)
)
GO
If I select Grid display it will have two result message:
in the result message
(3302 row(s) affected)
(3255 row(s) affected)
Stored Procedure: InternalEdu.dbo.getDueList
Return Code = 0
if I select text display, it will have only one reuslt message.
(3255 row(s) affected)
Stored Procedure: InternalEdu.dbo.getDueList
Return Code = 0
IF I selected , query result to file , it will have 3302 records.
Why ? Thanks.