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)
 SP's with varchar INPUT & OUTPUT

Author  Topic 

ruupy
Starting Member

6 Posts

Posted - 2001-01-25 : 08:36:11
Supose i'd like to use an SP to check for certain data in a db.
I have a variable (varchar) which contains the data needed for the check. All i need as output from the SP is an other variable (varchar of int) containing the result from the check, performed by the SP.

I got this far:-----------------------------------------------
CREATE PROCEDURE check_landcode
@@landcode varchar(10) --inout variabele
@@status varchar (3) OUTPUT --output variabele
AS
SELECT @@status = Land_Nr FROM tbl_PEC_LAND
WHERE Land_Nr = @@landcode
GO
--------------------------------------------------------------
I got this far, the '@@status' does not respond to an 'if @@status =''', i thought it to be a way to find out wether the SP got back amptyhanded.

Im a novice at SQL, i think that much is clear, all help is very welcom!!

GreetZ
RuupY

   

- Advertisement -