SQL Server Performance

summary

Discussion in 'ALL SQL SERVER QUESTIONS' started by immad, Jul 2, 2013.

  1. immad Member

    alter procedure [dbo].[pocc]
    (
    @empid nvarchar(10),
    @department varchar(10)
    )
    as
    begin
    create TABLE #TempEmployees
    (
    date datetime,
    eid int,
    remarks varchar(50)
    )
    -- Insert result from the SP to temp table
    INSERT INTO #TempEmployees
    EXEC dbo.at @empid,@department

    --Verify the Insert records
    SELECT
    *
    FROM #TempEmployees where eid=@empid
    end

    exec [pocc] 17074,''

    when i exceute its giving me that result

    date----------------------------eid--------remarks
    2013-01-06 00:00:00.000--17074---OFF DAY
    2013-01-07 00:00:00.000--17074---ABSENT
    2013-01-07 00:00:00.000--17074----Late
    2013-01-08 00:00:00.000--17074----HALFDAY



    how i make a summary result like this
    -----eid---offday--absent--late------halfday---
    -17074------1----------1--------1----------1------
  2. FrankKalis Moderator

Share This Page