Reply to Re: Executing Stored Procedures

Your name:

Reply:


Posted by Dan Guzman on 01/29/07 12:40

> I need to execute a stored procedure and pass each of the above as
> parameters:

One method is to select the values into local variables and then pass those
as parameters. For example:

SELECT
@CustID = CustID,
@CustName = CustName,
@CustContact = CustContact,
@CustPhone = CustPhone
FROM dbo.Customers
WHERE CustID = 1

EXEC @ReturnCode = dbo.MyProcedure
@CustID = @CustID,
@CustName = @CustName,
@CustContact = @CustContact,
@CustPhone = @CustPhone

--
Hope this helps.

Dan Guzman
SQL Server MVP

<Daniel.Peaper@gmail.com> wrote in message
news:1170066045.614229.220350@j27g2000cwj.googlegroups.com...
> Hi All,
>
> I am running SQL2000. Can anyone tell me how I can use the contents of
> a table as parameters for a stored procedure that resides on a
> different SQL server?
>
> I have a table:
>
> Customers:
> Cust_ID
> Cust_Name
> Cust_Contact
> Cust_Phone
>
> I need to execute a stored procedure and pass each of the above as
> parameters:
>
> @CustID, @CustName, @CustContact,@CustPhone
>
> The stored procedure also returns an error code.
>
> Thanks,
> Danny
>

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация