Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

insert statements - multiple Expand / Collapse
Author
Message
Posted Friday, October 05, 2012 5:34 PM
SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Tuesday, April 15, 2014 9:54 AM
Points: 1,720, Visits: 3,063
I have build database script, and one part of them is to insert data, so I have multiple insert statements 300000 records, it runs on and on,
and later gives an error:
HResult 0xE9, Level 16, State 1
Shared Memory Provider: No process is on the other end of the pipe.

Sqlcmd: Error: Microsoft SQL Server Native Client 10.0 : Communication link failure.

Is there a limitation of records? what does this message mean?

If I run it directly in SSMS, just a few records, it is OK, but if all of them,
it gives an error
insufficient memory to continue the execution of the program sql server 2008

Is there another option to insert these records, I know SSIS, but for this, because it is using a build script, so SSIS will not work.

Thanks

Thanks
Post #1369349
Posted Friday, October 05, 2012 10:25 PM
Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Wednesday, April 09, 2014 9:03 PM
Points: 1,128, Visits: 1,161
Ya i faced the same issue while creating a one time script . Since it was meant for another team , so I just had it executed in 5000 records batch..
it could be a workaround..


~ demonfox
___________________________________________________________________
Wondering what I would do next , when I am done with this one
Post #1369383
Posted Friday, October 05, 2012 11:43 PM


SSC-Insane

SSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-Insane

Group: General Forum Members
Last Login: Yesterday @ 7:53 PM
Points: 22,511, Visits: 30,236
Try running the script using sqlcmd. I have had this same issue with a few rather large scripts. Wouldn't run in SSMS but ran fine when I ran it from the command line using sqlcmd.



Lynn Pettis

For better assistance in answering your questions, click here
For tips to get better help with Performance Problems, click here
For Running Totals and its variations, click here or when working with partitioned tables
For more about Tally Tables, click here
For more about Cross Tabs and Pivots, click here and here
Managing Transaction Logs

SQL Musings from the Desert Fountain Valley SQL (My Mirror Blog)
Post #1369385
Posted Saturday, October 06, 2012 1:43 PM


SSC-Dedicated

SSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-Dedicated

Group: General Forum Members
Last Login: Yesterday @ 10:06 PM
Points: 35,978, Visits: 30,269
I don't know what the data looks like in the file but why not just use BULK INSERT?

--Jeff Moden
"RBAR is pronounced "ree-bar" and is a "Modenism" for "Row-By-Agonizing-Row".

First step towards the paradigm shift of writing Set Based code:
Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column."

"Change is inevitable. Change for the better is not." -- 04 August 2013
(play on words) "Just because you CAN do something in T-SQL, doesn't mean you SHOULDN'T." --22 Aug 2013

Helpful Links:
How to post code problems
How to post performance problems
Post #1369458
Posted Monday, October 08, 2012 4:10 PM
SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Tuesday, April 15, 2014 9:54 AM
Points: 1,720, Visits: 3,063
This reminds me, now I try to use:

Insert into...
Select * from another table

This makes it run very fast.
Post #1370096
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse