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)
 Invalid column name question

Author  Topic 

John T.
Posting Yak Master

112 Posts

Posted - 2003-06-16 : 15:49:57
Hope all is well with you people.
I have a table, Test. Two columns. Name and Inform. Name is vc 50 and Inform is vc 500.
CREATE PROCEDURE TestPP @name varchar(50),@ppinfo varchar(500) AS
Update TestPP Set Inform = @ppinfo where Name = @name
GO
The above sproc works fine.
When I try the following, I get the error "invalid column".
CREATE PROCEDURE LoadPP @name varchar(50), @ppinfo varchar(500) OUTPUT As
Select Inform from TestPP where Name = @name
Set @ppinfo = Inform
GO
In the first sproc, I simply write data from a textbox to the db. In the second one, I want to take the info in Inform and pass it to my program.
Thanks for any help. I have tried on my local server and remote host to create this sproc. Same results so I guess I will learn something here.
John

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2003-06-16 : 16:03:46
You have to set @@ppinfo in the SELECT statement.

CREATE PROCEDURE LoadPP @name varchar(50), @ppinfo varchar(500) OUTPUT
As
Select @ppinfo = Inform
from TestPP where Name = @name
GO

Tara
Go to Top of Page

John T.
Posting Yak Master

112 Posts

Posted - 2003-06-16 : 16:06:52
Thanks Tara.

Go to Top of Page
   

- Advertisement -