April 13, 2010 at 7:33 am
How is it possible? is there any way that we can make this happen?
Pramod
April 13, 2010 at 7:51 am
Need a little more information in order to even start assisting you.
Is it a single dimension array or a multiple dimension array?
Also .. some sample data (Items) the array will contain would be helpful.
With that information the experts here can begin to answer your question in a meaningful manner.
April 13, 2010 at 8:08 am
See, i have a table which has
employeenumber, day1effort, day2effort, day3effort, day4effort, day5effort, day6effort, day7effort
This table has some 100 rows.
Now, we are calling the SP for each row and the data is being passed as parameters to the SP.
since, it has 100 rows, the sp gets called 100 times. I dont want to do that. I want to send the complete table array to the SP so that the SP is called only once.
Please let me know if anything else is required.
Pramod
April 13, 2010 at 8:24 am
I know you posted in the 2005 group, but 2008 has probably the ideal solution for your problem: Table Valued Parameters. Or else I would make a second procedure that executes in bulk.
Ronald HensbergenHelp us, help yourself... Post data so we can read and use it: http://www.sqlservercentral.com/articles/Best+Practices/61537/-------------------------------------------------------------------------2+2=5 for significant large values of 2
April 13, 2010 at 8:25 am
I would strongly suggest you read this article by Jeff Moden and see if it is applicable to your situation
April 13, 2010 at 8:31 am
There are a few methods, but none of them are pretty. Note that in SQL 2008, you can pass a table variable to a procedure, but since this is a 2005 forum:
Note that these are listed in the order that I'm thinking of them.
1. Create and populate a table. Procedure references this table (but you still have to populate it row-by-row).
2. Convert the data into XML. Pass the XML to the procedure.
3. Convert the data into a delimited string, and pass it to the procedure.
This articles might be of interest to you:
Passing Parameters as (almost) 1, 2, and 3 Dimensional Arrays[/url]
Using XML to pass Multi-Select parameters from SSRS to SQL Server [/url]
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply