views:

39

answers:

0

Hi,

I need to pass a collection of objects as a parameter to a stored procedure. Initially, I thought of serializing this collection and passing it to the procedure as a xml string. Then, inside the procedure, I'd use XML to get the data from the string parameter and use it.

But I thought this approach was not performatic at all.

I was thinking about creating a global temp table (##temp), reflecting the properties of the TO, using a separate procedure for inserting the collection contents into the temp table, and then, from the second procedure, reading the data from the temp table.

I wonder if there's a better and more elegant solution.

Does anyone knows one?


UPDATE

I ended up using a mixed solution. My procedure receives a xml parameter and inserts its contents into a global temp table. The problem was I was querying the data directly from the xml. Now, when needed, I'm querying the global table, which proved to be a lot faster.