|
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
>
Navigation:
[Reply to this message]
|