title: Can Sql Server BULK INSERT read from a named pipe/fifo?
body: <p>Is it possible for BULK INSERT/bcp to read from a named pipe, <a href="http://en.wikipedia.org/wiki/Named_pipe" rel="noreferrer">fifo</a>-style?</p>
  
  <p>That is, rather than reading from a real text file, can BULK INSERT/bcp be made to read from a named pipe which is on the write end of another process?</p>
  
  <p>For example:</p>
  
  <ol>
  <li>create named pipe</li>
  <li>unzip file to named pipe</li>
  <li>read from named pipe with bcp or BULK INSERT</li>
  </ol>
  
  <p>or:</p>
  
  <ol>
  <li>create 4 named pipes</li>
  <li>split 1 file into 4 streams, writing each stream to a separate named pipe</li>
  <li>read from 4 named pipes into 4 tables w/ bcp or BULK INSERT</li>
  </ol>
  
  <p>The closest I've found was <a href="http://jcarlossaez.spaces.live.com/blog/cns!B3378F057444B65C!108.entry" rel="noreferrer">this fellow</a> (site now unreachable), who managed to write <em>to</em> a named pipe w/ bcp, with a his own utility and usage like so:</p>
  
  <pre><code>start /MIN ZipPipe authors_pipe authors.txt.gz 9
  bcp  pubs..authors out  \\.\pipe\authors_pipe -T -n
  </code></pre>
  
  <p>But he couldn't get the reverse to work. </p>
  
  <p>So before I head off on a fool's errand, I'm wondering whether it's fundamentally possible to read <em>from</em> a named pipe w/ BULK INSERT or bcp. And if it is possible, how would one set it up? Would <code>NamedPipeServerStream</code> or something else in the .NET <code>System.IO.Pipes</code> namespace be adequate? </p>
  
  <p>eg, an <a href="http://halr9000.com/article/702" rel="noreferrer">example</a> using Powershell:</p>
  
  <pre><code>[reflection.Assembly]::LoadWithPartialName("system.core")
  $pipe = New-Object system.IO.Pipes.NamedPipeServerStream("Bob")
  </code></pre>
  
  <p>And then....what?</p>