0

My company recently decided to move to ASP.NET MVC with all the bells and whistles. One of the technologies we now use is Entity Framework.

I need to call a stored procedure that runs a few selects and then writes the data to a flat file using BCP. When I execute the stored procedure using SSMS, it works perfectly fine, but when I let it execute through Entity Framework, the BCP command doing the export simply hangs until the connection times out.

I have started up SQL Server profiler and managed to grab the call to the stored procedure being sent through, which works when ran thru SSMS. If I open task manager and end the BCP process, the stored procedure continues processing everything else without any hassles.

What could be causing this and how can I get my stored procedure to run using Entity Framework?

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
SimonnD
  • 11
  • 2
  • Possible duplicate of [Getting data from stored procedure with Entity Framework](http://stackoverflow.com/questions/32140774/getting-data-from-stored-procedure-with-entity-framework) – Salah Akbari Jul 28 '16 at 09:54
  • What does your BCP command look like? Have you tried checking locks to make sure nothing is blocking? Here is onle example of when BCP might get stuck - when it prompts - http://stackoverflow.com/questions/32316921/writing-data-to-text-file-using-bcp-prompts-for-file-storage-type the question is why would it be prompting in this case? – Nick.Mc Jul 28 '16 at 12:14
  • .. and here's another example of it prompting. Though neither seems to be your case http://www.sqlservercentral.com/Forums/Topic409616-9-1.aspx – Nick.Mc Jul 28 '16 at 12:16

0 Answers0