You are here: Re: Executing Stored Procedures « MsSQL Server « IT news, forums, messages
Re: Executing Stored Procedures

Posted by Daniel.Peaper@gmail.com on 01/30/07 03:18

On Jan 29, 10:40 pm, "Dan Guzman" <guzma...@nospam-
online.sbcglobal.net> wrote:
> > 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.Pea...@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- Hide quoted text -
>
> - Show quoted text -

Thanks for that Dan,

Will this not just process the first record CustID=1? How would I go
about processing the whole table? Do I have to build a client
application to process a loop or can I proccess this on the SQL
server?

 

Navigation:

[Reply to this 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

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