|
Posted by nikolacace on 03/01/06 12:09
Hi,
I have a stored procedure (the code is below) that I use to retrieve
one value from my database. I tested the code in Query Analyzer, and it
works (I get the value I was looking for). However, when I call the
same code from the stored procedure, I get no value. The code that is
executed is the same and the input parameter is the same. Does anybody
have an idea?
The code:
SELECT Top 1
CharID,
CharName,
CategoryName,
CharDescription,
UserID
FROM [Character]
WHERE CharName='Character'
-- returns the right value
The Stored Procedure:
CREATE PROCEDURE SpCharacters_SelectOneByUserName
@UserName NVarChar
AS
SELECT Top 1
CharID,
CharName,
CategoryName,
CharDescription,
UserID
FROM Character
WHERE CharName=@UserName
GO
-- returns no value
[Back to original message]
|