Problem using Input parameters

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.
 
L

Lyle Fairfield

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top