display message while grid and text runing stored procedur

  • 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.

  • Your stored procedure has returns 2 resultsets:

    Select unit, JobCCNO,  [FULL NAME], SSN, EMPLNO ,[Unit Desc],  Department, Manager     from dbo.WinEmp

    select *  from dbo.WinEmp  E ....etc

    So in grid mode, 2 grids are displayed, one for each Select.

    If you are saving the results to file, you can only enter one filename so only the first set of results is being saved.

    I'm not sure why you are seeing only one set of records in text display, are you sure that the first set doesn't appear if you scroll up to the top of the window (or maybe scroll down to the bottom)?

     

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply