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
 SQL Server Development (2000)
 question with query

Author  Topic 

John T.
Posting Yak Master

112 Posts

Posted - 2003-06-25 : 20:44:12
CREATE PROCEDURE GetFP @name varchar(50), @site varchar(500) Output AS
Select @site = Site from FPTable where Name = @name
GO

I can't figure out how to include the column Inform in the above select statement. I am passing the value of the Site field back to a different part of the program than the Inform field, which goes to a datagrid.
I tried select @site = Site,inform from FPTable where Name = @name. Looked through all of my sprocs and can't find something like this.
Thanks.

simondeutsch
Aged Yak Warrior

547 Posts

Posted - 2003-06-25 : 21:23:13
If you're trying to get the site and the inform columns in one go, then this:

CREATE PROCEDURE GetFP @name varchar(50), @site varchar(500) Output,@Inform varchar(500) OUTPUT AS
Select @site = Site, @Inform = Inform from FPTable where Name = @name
RETURN

should work.
Alternatively, (not recommended!), you could avoid output parameters by returning the data from the stored procedure into a recordset.


Sarah Berger MCSD

Edited by - simondeutsch on 06/25/2003 21:25:48
Go to Top of Page
   

- Advertisement -