Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Using table in a stored proc

Author  Topic 

gamaz2
Starting Member

31 Posts

Posted - 2008-12-14 : 11:03:23
Hi I have redefined my problem in a simple way:
The data set obtained from a stored proc proc1 with input parameter @partnum is:

projectno partno
08-03520-00 E360MLID
08-03267-01 E360MLID
06-10595-03 E360MLID

Now I need to use the above set of data to a stored procedure proc2 with input parameter @projectno and @partno

and then get the result set.

How does one do this in stored procedure where instead of passing @projectno and @partno three times and get three output corresponding to executing the secong procedure three times
I want to execute the second procedure executed one time with the three sets of values and have one set of output.
I appreciate any help to resolve this. Regards.

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-12-14 : 12:29:03
pass them as a xml parameter to second procedure or as a comma seperated list. then write logic in secomnd procedure to parse xml/comma seperated list and get result set corresponding to them.
Go to Top of Page

gamaz2
Starting Member

31 Posts

Posted - 2008-12-14 : 12:48:59
Thanks visakh16 for the reply. This is the same proc. However I wanted to make the whole thing simplified so that it will be less confusing. The problem is that I have not worked with xml before. Is there any example link that is relevant to this issue you can post. That will be of immense help. Regards.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-12-14 : 12:55:30
http://vyaskn.tripod.com/passing_arrays_to_stored_procedures.htm
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-12-14 : 13:14:59
also see this if using sql 2005


http://weblogs.asp.net/jgalloway/archive/2007/02/16/passing-lists-to-sql-server-2005-with-xml-parameters.aspx
Go to Top of Page
   

- Advertisement -