Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Outofmemoryexpection

Author  Topic 

satheesh
Posting Yak Master

152 Posts

Posted - 2011-05-23 : 07:34:29
Dear All,

I have an insert query contails around 90K records.I tried to execute the query 'outofmemoryexpection thrown' error occured.

Could you please tell me how to short this issue and execute the query without error.Any help would be highly appreciated.Thanks in advance

Regards,
SG

GilaMonster
Master Smack Fu Yak Hacker

4507 Posts

Posted - 2011-05-23 : 07:35:29
What's the exact error message?

--
Gail Shaw
SQL Server MVP
Go to Top of Page

satheesh
Posting Yak Master

152 Posts

Posted - 2011-05-23 : 07:48:34
Thanks for your reply GilaMonster

The exact error

Cannot execute script
Aditional information
->Expection of type 'system.outofmemeory expection'was thrown.(mscorlib)

Regrads,
SG
Go to Top of Page

GilaMonster
Master Smack Fu Yak Hacker

4507 Posts

Posted - 2011-05-23 : 08:11:06
That looks like a .net error, hence it's an error in management studio, not SQL Server.

What exactly is that query trying to do?

--
Gail Shaw
SQL Server MVP
Go to Top of Page

satheesh
Posting Yak Master

152 Posts

Posted - 2011-05-23 : 09:37:19
Thanks for your reply Gilla Monster.

Sample Query:-

SET IDENTITY_INSERT [livecst] ON
GO
INSERT INTO ()VALUES()
INSERT INTO ()VALUES()
INSERT INTO ()VALUES()

SET IDENTITY_INSERT [livepcst] OFF
GO

Just an insert statment may contains around 90k

Regards,
SG
Go to Top of Page

GilaMonster
Master Smack Fu Yak Hacker

4507 Posts

Posted - 2011-05-23 : 09:48:09
You're trying to run 90 000 insert ... values statements? I'm not surprised Management Studio is running out of memory.

Where does the data come from? You're going to have to re-think how you're getting the data into SQL.

--
Gail Shaw
SQL Server MVP
Go to Top of Page
   

- Advertisement -