• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 5066
  • Last Modified:

Sqlcmd: MS SQL Native Client: Communication Link Failure

Hi guys -

I have a big sql file (~6gig) that I'm trying to execute via sqlcmd. It's just a bunch of inserts that were generated using the 'generate scripts' sql tool.

So I connect just fine
> sqlcmd -S .\SQL2008 -d MyDatabase -i "C:\sqlscript.sql"

This happens regardless if i do the -e or not.

So it goes through stuff for a while and then in execution i get:
HResult 0xE9, Level 16, State 1
Shared Memory Provider: No process is on the other end of the pipe.
Sqlcmd: Error: Microsoft SQL Native Client : Communication link failure
 error
Stuff does happen though since some records do get inserted.

Server timeout is set to 0. Named pipes and TCPIP are turned on

Any clue how to get the rest of the file to load in? I'm running SQL Server 2008 on Windows 7 64bit

Thanks!
0
rmm2001
Asked:
rmm2001
  • 4
  • 3
1 Solution
 
rmm2001Author Commented:
Oops I forgot to put this...

Here's what the logs say:

A fatal error occurred while reading the input stream from the network. The maximum number of network packets in one request was exceeded. Try using bulk insert, increasing network packet size, or reducing the size of the request. The session will be terminated.

My packets are set at 10240
0
 
Vitor MontalvãoMSSQL Senior EngineerCommented:
BULK INSERT should be better solution and it's easy to use. Or BCP it's the correspondent command line. Here you can find some help about the command: http://msdn.microsoft.com/en-us/library/ms162802.aspx

Good luck
0
 
rmm2001Author Commented:
So I tried the bcp. I made the file with -T -r -t -n. Then I load it in as -r -t -n and it gives me an EOF error. Is something just bad with my data or did a i miss a flag?
0
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
Vitor MontalvãoMSSQL Senior EngineerCommented:
Seems to me it's data problem but can't tell more without see.
0
 
Vitor MontalvãoMSSQL Senior EngineerCommented:
Can you share with us? May be useful for someone in future to resolve same issue.
Thank you.
0
 
rmm2001Author Commented:
I ended up using SSIS to do the load with max commit size being 50k - identity insert turned on. retain nulls turned on.
0
 
rmm2001Author Commented:
A different approach was used to do this same thing because nothing would work. Thanks for the info though!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: SQL Server Core 2016

This course will introduce you to SQL Server Core 2016, as well as teach you about SSMS, data tools, installation, server configuration, using Management Studio, and writing and executing queries.

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now