troubleshooting Question

parameterized stored proc not working

Avatar of Steve7423
Steve7423Flag for Canada asked on
DatabasesMicrosoft SQL ServerMicrosoft SQL Server 2005
3 Comments1 Solution171 ViewsLast Modified:
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
Join our community to see this answer!
Unlock 1 Answer and 3 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 3 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros