i got the solution
as follows:-
ALTER procedure [dbo].[fulltest]
(
@gl_acid int,
@userid int
)
as
begin
SELECT ROW_NUMBER() OVER (Order by gLedeger.PK_id) as sno,case when master.ma_accname is null then '' else ma_accname end as AccName,gLedeger.gl_date as date,gLedeger.gl_narration as Narration,gLedeger.gl_drcr as DRCR,
case when gLedeger.gl_drcr > 0 then abs(gLedeger.gl_drcr) else 0.00 end as debit,
case when gLedeger.GL_DRCR < 0 then abs(gLedeger.gl_drcr) else 0.00 end as credit,
SUM(gLedeger.gl_drcr) OVER(ORDER BY gledeger.pk_ID ROWS UNBOUNDED PRECEDING) AS Balance
FROM gLedeger LEFT JOIN master ON
gLedeger.GL_ACID = master.PK_ID left join registration r on master.userId=@userid
WHERE gLedeger.GL_ACID = @gl_acid
ORDER BY gLedeger.gl_date
end