none
Batching Sprocs RRS feed

  • Question

  •  

    I'm migrating my app from the now defunct Web Services Data Access module to linq. I am using Linq as a very basic DAL to control my existing Sprocs and I love it: No messing around with SqlParameters and DataReaders.  I've figured out how my Linq functions can use IMultipleResults to manually fill an object graph from the results, but I cannot see how to batch sql server requests. Is it possible or is the only workaround to create jumbo sprocs?

     

    Monday, June 9, 2008 7:37 PM

Answers

All replies

  • - sadly - there is no batching support in Linq to SQL. Old school Aggregator sp s are the best way so far.

     

    But there are some folks coming up with the idea of generating SQL Commands from DataContext and enabling batching through them, see this one for example :

     

    http://www.aneyfamily.com/terryandann/post/2008/04/Batch-Updates-and-Deletes-with-LINQ-to-SQL.aspx 

     

    But imho if I was to go in a custom way, I'd go for "jumbo" stored procs way.

     

    Sidar

    Monday, June 9, 2008 8:53 PM
  •  

    Ta very much Sidar.

     

    It is as I thought.  Trouble is I have been working all morning on creating and wiring up my jumbo sprocs. The O/R designer and intellisense still makes it easier than manually crafting SqlCommands, but with over 60 parameters it is still a lot of mind-numbing work.

     

    Microsoft please hurry up and implement batch control for sprocs and dynamic sql. Also while you are at it please implement support for other databases.

     

    Cheers

    Tuesday, June 10, 2008 12:48 PM