Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6329611
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T17:42:10+00:00 2026-05-24T17:42:10+00:00

Can Dapper batch a set of stored proc calls? I see it supports Multiple

  • 0

Can Dapper batch a set of stored proc calls? I see it supports Multiple Results in the documentation but I’m not sure if you can execute multiple stored proc calls using Dapper.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T17:42:11+00:00Added an answer on May 24, 2026 at 5:42 pm

    Dapper supports batching commands for stored procs:

    connection.Execute("create table #t (i int)");
    connection.Execute("create proc #spInsert @i int as insert #t values (@i)");
    connection.Execute("#spInsert", new[] { new { i = 1 }, new {i = 2}, new {i = 3} }, 
        commandType: CommandType.StoredProcedure);
    
    var nums = connection.Query<int>("select * from #t order by i").ToList();
    
    nums[0].IsEqualTo(1);
    nums[1].IsEqualTo(2);
    nums[2].IsEqualTo(3);
    

    The code above reuses the IDbCommand with the text #spInsert, 3 times. This makes batching inserts a bit more efficient.

    In general if you worry about perf at this level you would wrap the batch call in a transaction.

    Additionally Dapper supports whatever batch you decide to send it:

    connection.Execute(@"
        exec #spInsert @i = @one 
        exec #spInsert @i = @two 
        exec #spInsert @i = @three",
        new { one = 1, two = 2, three = 3 });
    

    Which would cause three rows to be inserted.

    Further more, if #spInsert returned a result set you could use QueryMultiple to execute the batch which would give you 3 record sets to iterate through.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there any way to use Dapper.NET with stored procs that return multiple result
Dapper can pass query parameters as anonymous objects, and supports any ADO.NET data provider.
I have a stored procedure that I'm trying to execute using Dapper that is
Can anyone help me as what is going wrong here? Am not able to
Can someone please explain what this means (from the Dapper.net website) Limitations and caveats
Can you have submenus with the top level set to checkable in WPF? I
I just upgraded to Hardy from Dapper and can't install java for the life
Can we set the alpha of drawable for its disable state through XML? For
Where can I find more information on connection pooling with Dapper.net?
can anybody tell How to give layouts folder name to support multiple screen size

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.