Link to home
Start Free TrialLog in
Avatar of Steve7423
Steve7423Flag for Canada

asked on

parameterized stored proc not working

I've worked with Access for over 10 years and I'm now learning the differences with SQL Server.  I've created a stored proc that uses a parameter.  for some reason it's not returning anything.  If I remove the parameter I get data.

ALTER PROCEDURE [dbo].[GetCompanyNameParam] (@cmpy nchar)
      AS
BEGIN
      SELECT company_venture from dbo.tbl_company where tbl_company.company_venture = @cmpy
END

right click the proc and select Execute stored procedure.  the dialog comes up where you enter your parameter value.  I type in the value that I know is in the field in the table and run it and it returns nothing.

I'm curious if the datatype is to blame.  the type is a simple string, "MyCompany"

what m I doing wrong???
ASKER CERTIFIED SOLUTION
Avatar of Patrick Matthews
Patrick Matthews
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Steve7423

ASKER

@#$%^ !!!    F^&ING  $%&* !!!!!!!!!!!  ahhgggggg !!!!


Thanks.  it worked.  Now I know to set the length of data types, where as in Access you don't.