Hai,
we are using SQL2008R2 ,Fetching data to the reports using SQL procedure.Each reports taking too mcuh memmory of our server and after execution memory is not going down. How can I achive this ?Each procedure for fetching data includes many nested loops which is unavoidable..If the records are less then the reports generation is faster
Server hve 24GB RAM and if we take two huge reports then memory will reach the maximum.When I limited SQL max capacity then always for small report also we face memory issue.
Now the max server 2147483647
Shall I add these 4 lines in the procedure, Will it push down the memory after the execution?
DBCC FREEPROCCACHE
DBCC DROPCLEANBUFFERS
DBCC FREESYSTEMCACHE ('ALL')
DBCC FREESESSIONCACHE
and where should I add these lines in the below procedure?
ALTER PROCEDURE..... if @Type='Reportsec' begin Declare @Rno bigint,@CntRcCnt bigint Create Table #Tmpdailyrep1_1(RECNO int identity primary key,fahrid bigint, Datum datetime,Lon float, lat ................. end