Skip to content
Advertisement

SQL multi save without using loop/ cursor

I have a requirement where from a string of int[] I need to insert all the values of this array into DB. I have tried this solution and it works fine.

To achieve this I have converted the int[] to XML in C#, and in SP used this XML variable to fill a table variable and looped over this table variable to do the insert.

Is there any way to avoid the while loop and insert multiple values comma separated string into the table ?

Below is the code :

Advertisement

Answer

Aren’t you just after this?

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement