Link to home
Start Free TrialLog in
Avatar of wolivier69
wolivier69

asked on

System.OutOfMemoryException When Running a Query

I get a System.OutOfMemoryException When running this as a stored procedure in visual studio.net 2010 but runs in SSMS. Is there a way to get it to run properly in a visual studio application?
WITH Children(PRINTUSERNAME,StaffNumber,Senior)
			AS(
			SELECT Distinct PRINTUSERNAME, StaffNumber,Senior
			From StaffPrintingDetailsInferno where StaffNumber = @Root
			UNION all
			SELECT m.PRINTUSERNAME, m.StaffNumber, m.Senior FROM StaffPrintingDetailsInferno m 
			INNER JOIN children l
			ON l.StaffNumber = m.Senior 
			)


SELECT * FROM Children

Open in new window

Avatar of Bob Learned
Bob Learned
Flag of United States of America image

When are you getting that exception?  Is this a run-time exception?  Did you install 2010 SP1?
Avatar of wolivier69
wolivier69

ASKER

its when i test and execute the stored procedure. I havent put sp1 on as yet
It works for some people but for others where the data is alot eg 3.5million lines it bombs out
Can you give me some idea of what you are working with (attach a .png screen shot)?  I am guessing that you are using the database tools from the IDE...
ASKER CERTIFIED SOLUTION
Avatar of wolivier69
wolivier69

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
When you have time, I would suggest look at installing SP1 (on a testbed if possible), and that error should go away (if I understand your question correctly).
Just didnt have time to try get it to work so broke it down and tried something else