Quantcast
Channel: SQL Server High Availability and Disaster Recovery forum
Viewing all articles
Browse latest Browse all 4689

SQL EATING MEMORY

$
0
0

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



Viewing all articles
Browse latest Browse all 4689

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>