Problem using Input parameters

  • Thread starter Thread starter Rob G
  • Start date Start date
R

Rob G

Hello,

I know Access 2K pretty well and now I am trying to learn SQL Server.
Someone suggested I use Access Projects to get my feet wet.

Using an Access Project, I made a Stored Procedure that has an Input
parameter. The code is as follows:

Alter Procedure ActiveOrTerm
@Status nvarchar
SELECT Name, PS_Status
FROM Master
WHERE PS_Status = @Status

When I run the Procedure and am prompted for the Status, I enter it (either
Active or Term) and get nothing (I don't put any quotes or anything). When I
change the procedure to this:


Alter Procedure ActiveOrTerm
@Status nvarchar

SELECT Name, PS_Status
FROM Master
WHERE PS_Status = 'Active'

It works fine. Although I just get the Active people, obviously.

Could someone tell me what I am doing wrong?

Thanks.

-Rob

p.s. The PS_Status field is datatype nvarchar, if that makes a difference.
 
Hello,

I know Access 2K pretty well and now I am trying to learn SQL Server.
Someone suggested I use Access Projects to get my feet wet.

Using an Access Project, I made a Stored Procedure that has an Input
parameter. The code is as follows:

Alter Procedure ActiveOrTerm
@Status nvarchar
SELECT Name, PS_Status
FROM Master
WHERE PS_Status = @Status

When I run the Procedure and am prompted for the Status, I enter it
(either Active or Term) and get nothing (I don't put any quotes or
anything). When I change the procedure to this:


Alter Procedure ActiveOrTerm
@Status nvarchar

SELECT Name, PS_Status
FROM Master
WHERE PS_Status = 'Active'

It works fine. Although I just get the Active people, obviously.

Could someone tell me what I am doing wrong?

Thanks.

-Rob

p.s. The PS_Status field is datatype nvarchar, if that makes a
difference.

@Status nvarchar(n)

where n = length of PS_Status
 
Back
Top