How to pass array of values into SQL Server stored procedure using XML(support.microsoft.com)

submitted by crpietschmanncrpietschmann(11.3k) 4 years, 3 months ago

This step-by-step article describes how to pass array of values into SQL Server stored procedure using XML format and how to use this array in a IN clause of the SQL statements. The sample strong in this article uses SQL Server .NET Managed Provider.

1 comment |category: |Views: 28

tags: another

new Add a live kick counter to your blog >> liveImage

You can even customize the image by choosing your own colors, and then clicking the button below to update the preview and the html code:

  • "Kick It" text
  • "Kick It" background
  • kick count text
  • kick count background
  • border

Simply copy and paste this HTML into your blog post.


Users who kicked this story:
Comments:

posted by GopinathMGopinathM(20) 4 years, 3 months ago 0

Alternatively you can pass comma separated values in a varchar/nvarchar type and apply table valued functions to split them as a list. I believe that will be faster than this method as XML overhead is very high. What do you say?

Reply

information Login or create an account to comment on this story