>Hi
>
>I have a stored procedure I am running in management studio.
>
>The stored procedure loops through a table and inserts items into some other tables.
>
>I've wrapped each loop in a transaction and commit the transaction at the end of the loop.
>
>after the stored procedure has been running through a couple of thousand records
>
>I get this error
>
>An error occurred while executing batch. Error message is: Exception of type 'System.OutOfMemoryException' was thrown.
>
>the stored procedure carries on.
>
>Any ideas what this error is about.
>
>Thanks
Do you really need loop processing? How big is your original table? Can you do all inserts as one set? Do you have SET NOCOUNT ON ; at the top of SP? Do you output some data back during procedure's life?
If it's not broken, fix it until it is.
My Blog